Question

I have been writing MVC apps using what I call the Service-Repository-UnitOfWork pattern, which looks like this:

MVC Controllers --> Services --> Repositories --> EntityFramework

and then

Repositories/EntityFramework (constructs Domain Objects/POCO) --> Services --> Transform to ViewModels --> Controller --> Send the ViewModel/View to the client.

I use a IoC Container to configure the Interfaces for the services, repositories and UnitOfWork, that are injected into the constructors of the various components.

My question is, does this resemble the Onion Architecture at all?

Does that make any sense?

Was it helpful?

Solution

No, it's not. Those are patterns from different categories.

Onion architecture governs entire solution, it is the same level as "multilayer" or "SOA" or "client-server".

"Service layer", "Repository", "UoW" represent implementation patterns, they govern specific parts inside you application.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top