| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: The wisdom of the object mentors (Was: Searching OO Associations with RDBMS Persistence Models)
On 2006-06-20 15:01:44 -0700, frebe73_at_gmail.com said:
>>>> Applications are generally independent of each other (altough they >>>> often communicate indirectly through the DB). >>> Unless you use reusable domain objects. Lets say we have a customer >>> table, does every application has its own customer class? >> In general, yes; although some applications might share for awhile. >> Still as more and more applications are added and changed, and more and >> more application specific methods are added to the Customer class, the >> application developers will feel the pressure to separate them.
No. Domain object should contain methods that *every* application uses. They should not contain methods that are specific to a single application.
>
>>> What are the forces to change databases that would not also force you >>> to change the application? >> You may add a new table that has meaning to 3 out of the 10 >> applications, but not to the other 7.
Unless you are adding new relationship tables that replace foreign keys.
>
>> It is the job of the application designers to keep the applications >> from being coupled to on another. If the applications are coupled, >> then changing one of them causes all of tem to recompile and redeploy.
Don't put application specific methods into the domain objects. As the
number of applications increases this gets harder and harder. In the
end, the domain objects tend to become very shallow in behavior, little
more than data structures.
>
>> for example, say we had a customer class. And in this customer class >> we had a print method. If some applications wanted one format for the >> printout, and others wanted a different format for the printout, we'd >> have to add more and more print functions to the customer class. Each >> new print function would force all the other applications to recompile >> and redeploy...
Precisely! Domain objects become less and less like objects as the number of applications increases. In the end they become more like data structures than objects. The objects have been moved into the applications and are application specific.
Conclusion of this analysis is that objects and databases are distinct creatures that have no overlap. Objects belong inside applications as a structural tool for the behavior. Databases belong outside the applications, and should be used by the objects within those applications.
-- Robert C. Martin (Uncle Bob) | email: unclebob_at_objectmentor.com Object Mentor Inc. | blog: www.butunclebob.com The Agile Transition Experts | web: www.objectmentor.com 800-338-6716 |Received on Wed Jun 28 2006 - 10:55:20 CDT
![]() |
![]() |