Mail-list selection-[refactoring] Table-driven designs versus gof-centric design patterns

Source: Internet
Author: User
Tags to domain

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.