P1:
I am learning about 'refactoring to patters' and have Joshua
Kerievsky's book. A colleague and I are debating the relative merits
The so-called table-driven design approach versus gof-centric design
Pattern approach: as a rule, do/shoshould one (or more) gof patterns
Supplant table driven designs? If so, how shocould such a refactoring
Proceed? Any thoughts on this are appreciated.
Sam
P2:
As I understand it Table driven design is about Data Modeling . There is
Focus on decoupling and at least a nod given to Domain Modeling so it
Shouldn't be completely incompatible with design patterns. However, the gof
Patterns almost all take advantage of polymorphism which will encourage
Use of inheritance and inheritance doesn' t mix terribly well with data
Modeling so you are probably going to run into some conflicts
There. I'm not well-versed in table driven design but the obvious advice
Wocould be to use Table driven design for your schema, patterns for
Application code and O/R Mapping to connect them . You might want to read
Eric Evans 'domain driven design and pay careful attention to what he has
Say about Entity objects . Those are the objects that will generally be
Data-heavy and therefore most influenced by a Data centric design
Discipline. The domain driven approach will also make it more likely that
Data and behavior will decompose along similar lines so there will be fewer
Conflicts between the different approaches that are being advocated by your
Team.
Broadly speaking there are three reasons to refactor:To remove duplication,
To prepare for the addition of new codeOrTo clarify the design. It is
Tempting to attempt a large refactoring immediately following a teamwide
Shift in design philosophy. I recommend that you resist this temptation and
Do the refactoring incrementally as you are writing new code. This approach
Will give you an opportunity to learn from the results of one refactoring
Session before embarking on the next. It will also keep your refactoring
Efforts focused on the code that matters the most -- the code that you are
Changing in order to add business value. Finally, in general it's best
Keep code that's concerned with storage or communication more data-centric
And more coarse grained; and business logic, UI and especially API code
Behavior centric and abstract.
Phil