Re: Implementing a folder object?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Dave Veeneman (davidv_at_nospam.com)
Date: 04/03/04


Date: Sat, 3 Apr 2004 05:20:13 -0600

One final note-- I tried short-cutting the implementation of the GoF
Composite pattern by simply slapping a Children property onto my Apples and
Oranges classes. I ended up needing a lot of tangled code to keep straight
whether I was dealing with a folder or an item. So, I've gone back and
refactored to implement the pattern as suggested by the GoF in both classes.

The lesson I learned: The GoF patterns are held in high esteem for a reason.
They really are time-tested solutions to recurring problems. Short-cutting
them can easily lead to more refactoring down the road.

-- 
Dave Veeneman
Chicago


Relevant Pages

  • Re: Why encapsulate state pattern......
    ... >> from GoF the state pattern is to..... ... >> its interface, but you can't), then why not just change it. ... > abstraction that can have a unique identity while living as one subclass ...
    (comp.object)
  • Re: Databases as objects
    ... TM>There are no real rules for when to use what GOF pattern, ... I contend that GoF have such rules: ... change needs often change over time. ... Steven Perryman ...
    (comp.object)
  • Re: Factory pattern
    ... I see that GOF made a great disservice to programming ... community by publishing their "masterpiece". ... to pattern languages). ...
    (comp.object)
  • Re: Factory pattern
    ... I see that GOF made a great disservice to programming ... community by publishing their "masterpiece". ... Dont Jump Start to pattern Catalog...Start with Beginning Chapter of ...
    (comp.object)