Questions tagged [onion-architecture]
The *Onion Architecture* is a software architecture proposed by Jeffrey Palermo. It is similar to the *Hexagonal Architecture* (Ports and Adapters) proposed by Alistair Cockburn.
11
questions
131
votes
7
answers
72k
views
Clean Architecture: Use case containing the presenter or returning data?
The Clean Architecture suggests to let a use case interactor call the actual implementation of the presenter (which is injected, following the DIP) to handle the response/display. However, I see ...
10
votes
1
answer
5k
views
Where should I place configuration classes in Onion Architecture
We are redesigning one of our API projects from an n-layered architecture into onion architecture. In the previous design, we had configuration classes in a common library project being referenced ...
1
vote
3
answers
3k
views
Domain Driven Design in an Onion Architecture
I recently asked this question: Should the domain layer be dependent on NHibernate?
I have read a lot of questions today, where answerers state that the Domain Layer should only contain Business ...
21
votes
2
answers
16k
views
What data should a repository return
I have a simple project where the controller calls the service, and the service calls the repository in order to get the needed data.
Assuming that we have these domain models:
// this model has a ...
14
votes
2
answers
13k
views
Onion architecture vs 3 layered architecture
I see only benefits to the onion architecture over the 3 layered architecture where the BL had responsibility to call methods on DAL (or an interface of DAL) to do CRUD. The onion has better ...
10
votes
4
answers
3k
views
Lookup Tables: Are they a leak in the domain model?
You are building a system that keeps track of Companies. Those companies have Contacts. Those contacts are often specialists that only answer certain types of questions, such as Billing/Payment, Sales,...
8
votes
2
answers
14k
views
How to structure an Onion project
Here is an example implementation using Onion architecture: https://www.codeproject.com/Articles/1028481/Understanding-Onion-Architecture
The webpage suggests a solution structure of:
Domain - ...
6
votes
3
answers
520
views
Where to convert primitive types in meaningful types in Clean Architecture / Onion Architecture
The book "Implementing Domain Driven Design" (page 361) suggests to use special types to distinguish several kinds of IDs, e. g. using BookId(1) instead of just 1 of type Int or Long. In my Clean ...
5
votes
2
answers
12k
views
How to structure a Domain Driven Design in an Onion Architecture?
I am studying Domain Driven Design and was introduced to the concept of Onion Architecture, which uses the terms of Core, Domain, API, and Infrastructure.
I am from Java background and am familiar ...
1
vote
2
answers
240
views
How to structure libraries/solution for Onion Architecture with Model View Presenter pattern?
Hobby coder here, so please be gentle! My coding is taking me into the necessary realms of architecture due to increasingly complex apps. I'm wondering how to structure my solutions which will involve ...
-2
votes
1
answer
554
views
What is a simple implementation of onion architecture for C# ASP.NET Core WebAPI and SQL db that is not full DDD and CQRS?
I'm a programming teacher. My students learn structured and then object oriented programming in JavaScript and C#. They learn SQL, MS SQL Server, Dapper and EntityFramework Core.
After this they ...