Chapter 21. Data class design

 

This chapter covers:

As we’ve seen, the marriage of a database and an object-oriented program is usually not a match made in heaven. It’s more of an arranged marriage, although casual relationships are also possible.

Some ceremony is helpful in getting the liaison started. The patterns presented by Martin Fowler in Patterns of Enterprise Application Architecture [P of EAA] are a good rough guide to the alternative ways of creating a systematic and lasting bond between data storage and program code. In this chapter, we will approach these patterns from a slightly different perspective, trying to create some shortcuts along the way.

And, of course, we would like the classes and the database to live happily ever after, but like it or not, we are likely to find ourselves having to work on the relationship. Refactoring is as important here as in other parts of the application.

21.1. The simplest approaches

 

21.2. Letting objects persist themselves

 
 

21.3. The Data Mapper pattern

 
 
 

21.4. Facing the real world

 
 

21.5. Summary

 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest