O'Reilly logo

PHP in Action: Objects, Design, Agility by Chris Shiflett, Marcus Baker, Dagfinn Reiersol

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 21. Data class design

21.1 The simplest approaches 471
21.2 Letting objects persist themselves 479
21.3 The Data Mapper pattern 486
21.4 Facing the real world 490
21.5 Summary 492

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, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required