Frank Sommers
Posts: 2642
Nickname: fsommers
Registered: Jan, 2002
|
|
Re: Working the Program
|
Posted: Jan 8, 2004 12:11 AM
|
|
I agree with Ward that a lot of what we consider great design is often a product of evolution, rather than someone sitting down and figuring everything out up-front. I used to start designing things by first defining the interface of some component, and then figuring out how the desired components interact via their interfaces. While I still think there is room for that sort of approach, I now tend to build things by creating small pieces of functionality, and then refactoring them according to some logical criteria that often emerges during the process. I suppose that that latter approach is similar to the molding of clay, or of marble, that Ward talks about.
While at first I didn't like that latter approach on intellectual grounds (I considered it "hacking" vs. architecting), the "molding the clay" approach proves more effective than the "top-down" architecting approach in many situations. Interestingly, and counter to my initial intuition, the upfront architecting approach seems to work well on smaller projects. As the size of the project grows, and with it the number of requirements and classes, having a clear-cut, initially well thought-out architecture often becomes a burden. At some point, the decision must be made to either completely revise the up-front design (which makes that design less up-front), or just simply go without a grand design.
In lieu of a grand design, what I often find useful, though, are idioms. These are not really patterns in the fancy sense of the word, but just small habitual ways of doing things. If an idiom works well, reusing that idiom over and over again helps give the program a sense of unity, since even a large program can often be reduced to a handful of idioms. The set of idioms give the program a sense of Gestalt. Also, developers reading code based on idioms have to understand only those handful of idioms to start contributing to the program.
|
|