Philippe Lhoste
Unregistered
|
Excellent article, poor example
06/26/05 05:47 AM
|
|
|
Your article is truly excellent, one of the best I have seen on design patterns (even if I am just starting to read these). I look forward to the other articles (I started with flyweight because of the funny name and because it is not very well known/often mentioned).
The comments help understand some points too.
But I am a bit disappointed by the provided example. Indeed, it illustrates the pattern, with respect to the UML schema and as such helps understand how to implement it. But it shows little of the interest to use such pattern, as it is hard to see any improvement over the procedural implementation (more OO? How?).
I understand you have little room in this article, so you cannot put a complex example. Fortunately, you also give some more signifiant real world examples.
Note that your color example reminds me of Windows resource management: in a time were graphic cards has less memory than main boards , resources were limited. So one has to create logical-to-physical entities like brushes or pens. These managed scarce resources like colors in a limited palette, small space for graphic resources, etc.
So if you map your Line objects to material colors, it makes more sense. Does it? I hope I am not mixing things up.
|
|