Mastering a project template

Hi everyone, I'm trying to build a solution using the DDD approach. Ive created a set of entities, and some datamappers that I use to remove the persistence dependency of data from entities. Is this right for me, use datamapper as the "finder" class, I have methods like

GetByID () getUsersByRanking () getByLastName ()

or should datamapper not contain specialized search methods and use only getById ()?

Is it true to me that the Repository template is used to remove the specialized search methods that I added to the datamapper, and instead provide the client with a query language that they can use instead to find objects for others means identifier ?.

I really hope someone can help me clarify how these patterns interact with each other. Domain Model, Datamapper, Data Presistence, Repository.

I read a lot at Martin Fowler's POEAA, but having difficulty connecting the dots :)

+4
source share
1 answer

Lets sit down that repositories are an entry point for objects in DDD. You can create an abstract, and then specialize it for each object. That way, you can query the repository every time you need to get an entity. Datamapper is a solution for mapping objects to their database views or any other repositories. Therefore, I assume that datamapper should be hiding behind the repository template.

0
source

All Articles