... we cannot construct a complex system in both ways simultaneously, for they are completely orthogonal views.
... the object-oriented approach is better at helping us organize the inherent complexity of software systems.
... just as it helped us to describe the organized complexity of complex systems as diverse as computers, plants, galaxies, and large social institutions.
... object-oriented decomposition has a number of highly significant advantages over algorithmic decomposition.
- Reuse of common mechanisms
- More resilient to change and thus better able to evolve over time
- Reduces the risk of building complex software systems
- Because they are designed to evolve incrementally from smaller systems in which we already have confidence
Mediates between the domain and data mapping layers using a collection-like interface for accessing domain objects.
... an object that can provide the illusion of an in-memory collection of all objects of that type.
... Provide methods to add and remove objects
... Provide methods that select objects based on some criteria, and return fully instantiated objects or collections of objects whose attribute values meet the criteria.
However, an object-relational mapping tool also provides an abstraction over a persistence mechanism, but it is neither a Repository nor a DAO.
DAO facilities (perform fine-grained CRUD operations on data):
Table Module, Table Data Gateway, and Active Record are patterns typically used in a Transaction Script application. Because these patterns tend to serve as wrappers around database tables, we likely avoid using them with a domain model.
On the other hand, Repository and Data Mapper, having object affinity, are typically the patterns that would be used with a domain model.