I'm currently learning DDD and in my sample project, I have some questions with regards to architecture.
Right now, I have this:
WPF application (references service proxies which is in a separate assembly) -> Services (where the proxy came from) which references -> Domain layer (contains Domain objects and Repository interfaces) which then accesses -> DAL (which implements the repositories)
Questions:
I know the answer depends on the situation but generally, is this architecture in the right path assuming all layers are needed?
This is the first time I am using repository pattern, right now, my services has a constructor that accepts an IRepository. Where does the injection take place? Should the service layer contain a config file for what repository should be used? So this means, the service layer references both the repository interfaces in the domain layer and its implementation in the DAL?
The WPF app references the service proxies so the constructor with a IRepository parameter doesn't get generated. Supposed I decided to use the services directly from WPF (no service proxies), how do I instantiate the service with an IRepository parameter from UI? I would need to add a reference to the DAL which contains the implementation of the repository? Is that OK or correct?
Also, this design also means that the DAL should know about the IRepository interface (because they will implement the interface) as well as the Service Layer who will use the repository implementation. But my repository interfaces are in the domain layer; the DAL would need to reference the domain layer to get those interfaces which I think is wrong since I'm referenceing upstream. How do I do this?