Database

  • Decoupling Your Domain: Understanding the Data Mapper Pattern

    Connecting your application’s core logic (the domain objects) to a persistent store (like a database) is a fundamental task. However, directly embedding database logic within your domain objects can lead to tight coupling, making your code harder to test, maintain, and evolve. How can we keep these concerns separate? Enter the Data Mapper pattern. As Martin Fowler describes in “Patterns of Enterprise Application Architecture” (P of EAA, page 165): A layer of Mappers that moves data between objects and a database while keeping them independent of each other and the mapper itself.
    Read more...