Composed Method
This pattern is probably my most favorite. The inherent value of small, manageable, legible, understandable, and easily over-ridable methods is perhaps unmatched. How many times has a subclass and a couple of over-ridden methods provided the simple and elegant solution we were after. Or, how many times have we been in the position of having to either copy and paste a “one off” of these methods or completely rewrite the methods, spiking our software stability and test values in the negative direction?
The latter is the position I find myself in most as of late, working on legacy code with no pattern to be found. I attempt to make small improvements and slowly right the ship but the design is so poor that I often feel frustrated and incapable of achieving any real accomplishment through my efforts. I persist however, because I believe in the beauty of this pattern. Testability is of primary concern with this system as it is incomplete, incorrect, and non-repeatable at best. Again I forge through, making the methods smaller, observing the Law of Demeter, using Type Suggesting Parameters, et al.
A system rewrite is in the near future and so my efforts are further daunted by the realization that they don’t matter value-wise as much as I would like to believe they do. I must continue though. I am slowly communicating the brilliance of Kent Beck’s software patterns and even presented a few today.
I love what I’ve learned despite the frustration of my environment. Thanks a bunch Kent.

Leave a comment