Steven Sacks wrote:

> Your initial hunch is that your problem would best be solved by the
> Decorator pattern, but it very well may not be.  The Decorator pattern
> has fallen out of favor in recent years, as many people believe it
> violates good OOP practices.  It has its uses, but they're limited.

Design Patterns, the book by the gang of four, is a very, very good book,
but I wouldn't make it my only way of structuring code. Read it, use it, but
be aware of its limitations.

The OOP paradigm has gone through different phases. At first it was all
about inheritance and reusable code. Then we discovered composition, and
pretty soon everybody was doing composition.

"Design Patterns" is very strongly composition-oriented, to the point of
almost being dismissive of inheritance. And, sure enough, the pendulum has
swung back to a more inheritance-centric OOP paradigm.

In practice, both inheritance and composition are important, useful
approaches to OOP design. I'm a stubborn old cuss, and I've always resisted
following the latest trend ("extreme programming" and the like). I read,
observe, and cherry-pick what looks useful to me.

I guess I'm saying pretty much the same thing Steven is--don't just follow
the gurus. Understand the guru's approach, then choose what's useful to you.
The gang of four, as good (and popular) as they are, don't have all the
answers.

Cordially,

Kerry Thompson


_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to