Is this a DDD application or domain service?
I am kind of new to the whole domain-driven design thing and would love it if you could tell me where you t开发者_运维百科hink a service method like this belongs, in the application or domain layer:
List<Children> getChildrenByParent(Parent parent, int offset, int count) {
return repository.listChildrenByParent(Parent parent, int offset, int count);
}
I also wonder if this is an acceptable way of doing things when there are huge collections of entities in the model and/or when I need to filter things efficiently.
Thanks
The method you list doesn't seem to have any point. Why make a method getChildrenByParent that exactly wraps repository.listChildrenByParent? It's already in the correct spot - on the repository. Just use repository.listChildrenByParent where you need it.
One of the thought process is to separate the core functional domain from the query domain (reports, search etc). The method you added seems to be for reporting or search purposes. U should call the method in repository directly
精彩评论