Please join us at the new JavaWorld Q&A Forums. Your existing login will work there. The discussions here are now read-only.
Anonymous
Unregistered
|
Good article...but...
01/10/04 08:52 AM
|
|
|
Love the article (as with all the design patterns ones, it's very useful). However, isn't the Line example just an implementation of a Factory pattern - you don't actually have an unshared flyweight object. To be a true implementation of the flyweight pattern, shouldn't you have your existing Line class holding the intrinsic state (i.e. the colour), then a FlyweightLine class which holds the end points of the line, and a reference to the shared Line object. This would also solve the redrawing problem mentioned by someone else if you held a list of all the FlyweightLine objects.
Cheers
Jim
|
|
Good article...but...
|
Anonymous
|
01/10/04 08:52 AM
|
|
0 registered and 1 anonymous users are browsing this forum.
Moderator:
|
Forum Permissions
You cannot start new topics
You cannot reply to topics
HTML is disabled
UBBCode is enabled
|
Rating:
Thread views: 5908
|
|
|
|
|
|
Powered by UBB.threads™ 6.5.5