The active record pattern

There are many architectural patterns that may or may not help in your projects; in particular, regarding domain models and persistence. You might want to have a look at the active record pattern. An active record class encapsulates not only the data, but also its persistence operations. For example, the Order class of the previous example would look like the following:

Notice how the CRUD operations are implemented in the domain class alongside with the methods previously implemented in the repository class. Although being an alternative to keep in mind, we won't further cover or use the active record pattern in this book.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset