Originally posted by Louis Wang:
Am I going in a wrong way?
Design Patterns aren't cookie cutters or Simplicity (sewing) patterns. There is no need for a 100% match of all features. Given a problem of a particular type it represents the
essence of a recurring solution that balances often competing forces of design principles.
Given that the motivation and the "balance" for any concrete problem is going to be somewhat different from the ones stated in the pattern description it must be expected that every application of a pattern is going to emphasize some aspects over others, sometimes to the point that some
non-essential (but often useful) aspects may be ignored. When you apply patterns you are not just working in black and white, you are very much working in continuum of grays, using what you need for your particular problem (which sometimes means not using patterns at all).
Ultimately mastery of the
Object-Oriented design priciples is more important than rote learning of a litany of design patterns. Familiarity with these design principles will tremendously aid in the understanding of design patterns as each of them typically use a number of these principles to arrive at their essential solution. These design principles also guide you when you adapt design patterns to your concrete problems.
Also don't lose sight of the fact that design patterns greatest contribution is probably in the area of design communication (written or oral).
What Larry Wall said about Perl holds true: "When you say something in a small language, it comes out big. When say something in a big language, it comes out small". The same is true for English. The reason that biologist Ernst Haeckel could say "Ontogeny recapitulates phylogeny" in only three words was that he had these powerful words with highly specific meanings at his disposal. We allow inner complexity of language because it enables us to shift that complexity away from the individual utterance.
p. xlv,
The Ruby Way, 2e (
amazon US) by Hal Fulton
In other words design patterns let us express "big ideas" simply.