Cool objects Sleep on the Couch (Sebastian Bergmann) Domain logic and persistence layer are tangled - No locality of change - No separation of concerns - Domain logic cannot be used - tested, for instance- without the persistence layer How can we map the model to the database Active record : An object that wraps a row in a database table or view, encapsulates the database access and adds domain logic on top of it. Active record may be used to implement Object-Relational Mapper (ORM) but it should never be used as one. ORM: Programming technique for converting data between incompatible type systems in relational databases and object-oriented programming languages [that] creates a "virtual object database" Unit of work: Maintains a list of objects affected business transaction and coordinates the writing out of changes and the resolution of concurrency problems. Identity Map: Ensures that each object gets loaded only once by keeping every loaded object in a map. Looks up objects using the map when referring to them Lazy Load: An object that does not contain all of the data you need but knows how to get it. Wakeup will be called by the Object Freezer