Persistent Domain Objects Pattern
Persistent Domain Objects Pattern
Submitted by webmaster@testdriven.com (Links) on Tue, 10/05/2005 - 13:54.Persisting domain objects is one of the most challenging aspects of designing a flexible and testable enterprise application. There are lots of examples, in the industry, when developers get it wrong and end-up either with an effectively procedural, non-object-oriented structure and/or a highly complicated, tightly coupled design which is hard to unit-test.
Persistent Domain Objects Pattern gives a solution to tight-coupling of the persistence and application logic code. PDO decouples those by extracting the details of the persistence implementation and hiding it behind an interface, employing Dependency Injection techniques. As a result, domain objects do not need to know or worry about the details of the persistence code and can concentrate on their main task - delivering encapsulated data and behavior that models the domain under question. It, also, makes domain objects, much easier to unit-test in isolation from its dependency - persistent storage (e.g. database). Effective unit-testing increases the quality of a programming code and its extensibility.
Author: Irakli Nadareishvili
Published: TheServerSide, April 19, 2005
Persistent Domain Objects Pattern gives a solution to tight-coupling of the persistence and application logic code. PDO decouples those by extracting the details of the persistence implementation and hiding it behind an interface, employing Dependency Injection techniques. As a result, domain objects do not need to know or worry about the details of the persistence code and can concentrate on their main task - delivering encapsulated data and behavior that models the domain under question. It, also, makes domain objects, much easier to unit-test in isolation from its dependency - persistent storage (e.g. database). Effective unit-testing increases the quality of a programming code and its extensibility.
Author: Irakli Nadareishvili
Published: TheServerSide, April 19, 2005
