Login :
Password :

Design patterns

Images composition

Problem wording :

Design a system enabling to draw a graphic image. A graphic image is composed of lines, rectangles, texts and groups. A group may be composed of other groups, lines, rectangles and texts.

Optimal solution :

Static diagram :

Static diagram

This solution allows a good decoupling, and a good extensibility.

Alternative solution 1 :

Static diagram :

Static diagram

This solution has no decoupling, no extensibility and the composed objects have not a uniform processing

Click here to see the spoiled pattern deduced from this alternative solution

Alternative solution 2 :

Static diagram :

Static diagram

No decoupling, no extensibility and none uniform protocol in this solution. Only the unique access point for the client is present.

Click here to see the spoiled pattern deduced from this alternative solution

Alternative solution 3 :

Static diagram :

Static diagram

Probably the worst solution. No decoupling, no extensibility and none uniform protocol

Click here to see the spoiled pattern deduced from this alternative solution

Alternative solution 4 :

Static diagram :

Static diagram

In this solution, there is no decoupling, no extensiblity. Except for the composition managing, there is no uniform protocol

Click here to see the spoiled pattern deduced from this alternative solution

Alternative solution 5 :

Static diagram :

Static diagram

No decoupling, no extensibility, but there is a good effort on uniform processing

Click here to see the spoiled pattern deduced from this alternative solution

Alternative solution 6 :

Static diagram :

Static diagram

Except the non-maximal factorization of the composition and the non-uniform protocol on composition managing, this solution is not so bad.

Click here to see the spoiled pattern deduced from this alternative solution

Les têtes de mule
Cédric BOUHOURS
Cédric BOUHOURS
Cédric BOUHOURS