Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. COYou just create another level (repository) over the DAO, but the question still remains. What should I use? One specific repository that calls other repositories? Or call each repository sequentially (see the example with DAOs in my answer)? Finding all items by named category is an action that no Entity and no repository can provide. For the sake of encapsulation and re-usability it should be encapsulated into something like Service. And not necessarily Service as it defined in DDD context, you can as well call it Action or Command, just some layer that encapsulates common operations.
      singulars
    2. COThe repository has avrey clear purpose: to separate the persistence details from the rest of the application. DAO are implementation details. The repository interface is deisgned according to the application usage, you can say somehow that the repository is itself a kind of service used by the app. Finding all items by named category is exactly a method of the repository which will use the necessary DAOs to get those results. Then the repository 'transforms' the persistence objects into application objects (usually via automapping)
      singulars
    3. COI agree with the roles of the repository as you described it. But lets clarify: Can repository call another repository? What repository should implement the method `FindItemsByCategoryName`, the `CategoryRepository` or `ItemsRepository`?
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload