One of Agile Modeling's practices is Apply
Patterns Gently (
http://www.agilemodeling.com/practices.htm#ApplyPatternsGently ). This
idea came from Josh Kerievsky's original paper presented several years ago
at the XP conference in Italy. The basic concept is that developers should
consider easing into the application of a pattern, to apply it gently. This
reflects the value of simplicity. In other words, if you SUSPECT that a
pattern applies
you should apply it in such a way as to implement the
minimal amount you need today but that makes it easy to refactor it later
when it is clear that applying the full-fledged pattern is in fact the
simplest approach possible. In other words, don't over model. For example,
you may recognize a good spot in your design to apply the GoF's Strategy
pattern, but at the current moment you only have two algorithms to
implement. The simplest approach might be to encapsulate each strategy in
its own class and build an operation that chooses them appropriately and
passes them the appropriate input. This is a partial implementation of
Strategy that leaves you in a position to refactor your design if more
algorithms need to be implemented, yet does not require you to build all
the scaffolding that Strategy requires -- an approach that enables you to
ease into application of the pattern.
Anyway, as many of you know Josh has been doing really good work on this
concept and his book Refactoring to Patterns
(
http://www.amazon.com/exec/obidos/ASIN/0321213351/ambysoftinc/ ). I've
been reading it over the past couple of weeks and have been very
impressed. This book is going to become one of my key reference books. If
you're serious about agility I highly recommend it.
- Scott