Pergunta

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?

Foi útil?

Solução

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top