I'm trying to use a layered pattern and DDD. But I can't find where should I load the catalogs used to populate comboboxes and listboxes in an edit view of a single model entity. Should I create a single method in the application service layer to get all the lists that I need for a single view, in a viewmodel wrapper? Or should I create one method per every list I need? Or it doesn't belong to the service layer at all?
There are two main tactics to access your data from the presentation layer that all have their pro's and cons. To summarize:
An application service layer serves as an API for the presentation layer(s) to the layers below. This means that the application services are boundary objects. You may still expose entities and value objects via the application services, but services and repositories remain completely hidden from the presentation layer.
Advantages:
Disadvantages:
A sub-tactic that I have seen is that both application services and domain services are used within the presentation layer, see this article for example. Although I agree with the author's stance that application services and domain services are fundamentally different I disagree that both should be usable from within the presentation layer. The purpose of having an application layer is best served when the application services serve as a boundary. This does increase the amount of wiring code, but makes it easier to add application logic at a later stage. I would therefore argue that if you choose this tactic you go all the way.
You can simply call the repositories and/or services from within your presentation layer.
Advantages:
Disadvantages:
Another sub-tactic that I have seen in the wild is that the domain services act as a boundary objects to the presentation layer. The repositories are therefore ruled not accessible to the presentation layer. This I would call an anti-pattern since application logic, repository logic and domain logic are clearly different types of logic (to some this is not so clear though). If all needs of the presentation layer need to be met by domain services the domain services will either become delegates to the repositories (bad) and application logic will end up in your presentation layer (may be acceptable) or/and application logic will end up in the the domains services (bad). Domain services in DDD where never meant as boundary objects, but simply as containers of operations related to domain concepts that are not a natural part of an entity or value object. Again, I would therefore argue that if you choose this tactic you go all the way.
I hope I have reduced this rather complex and multi-faceted discussion a bit, so that you may choose which tactic fits your use best. There is no clear consensus in the software industry about these things. I usually pick the first tactic for software that is guaranteed a long live or which has several presentations and the second for software which future is still somewhat uncertain and has a single presentations.