Reputation: 2440
Good morning, My question is about Visual Studio project/catalog structure. I'm creating a simple project and I want to adopt Onion Architecture there. I have few layers (projects): MyProject.Domain (with Enums, Entites, Interfaces), MyProject.API, MyProject.Infrastructure.DependecyResolution, MyProject.Client.WPF
I want to use Abstract Factory Pattern. I have factory class, and few product classes.
My "product's" interfaces are in Domain->Interfaces, my "product's" implementations are in Domain->Entites. Where in my Visual Studio Solution, should I put interfaces and implementations of Factories (that will create those products)?
My question is: Is Factory interface or Factory concrete implementation part of Domain in Onion Arch.? Or should I create another project for factories? This question is more about good programming practices, maintaining Visual Studio solution clean and tidy.
Upvotes: 0
Views: 1473
Reputation: 11
my idea is make Ifactories folder in domain project in core of software,but bring implementation of them in upper layers
benefit of bring interfaces in core is upper layers can use them
benefit of bring implementation in upper layers is encapsulating implementation
Upvotes: 0
Reputation: 12882
My question is: Is Factory interface or Factory concrete implementation part of Domain in Onion Arch.?
I'm not an expert in Onion Architecture philosophy, but there are a few arguments to put the Factories in the same package as the products:
Upvotes: 2
Reputation: 31950
There isn't a single correct answer. Maybe you can create a folder 'core' where you put all of your core code. There's nothing wrong with just creating an 'interfaces' folder inside this and it's common to see a folder called 'entities' containing the various data classes.
Upvotes: 3