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.

Jeffrey Palermo proposed the Onion Arcitecture. It is similar to Alistair Cockburn's Hexagonal Architecture or Ports and Adapters.

The fundamental motivation of the approach is to avoid layer-to-layer dependencies usually associated with the N-tier architecture approach. This is achieved by placing all infrastructure, including databases, outside the problem domain.

According to Jeffrey Palermo:

The overall philosophy of the Onion Architecture is to keep your business logic and model in the middle (Core) of your application and push your dependencies as far outward as possible.

The problem domain is then completely independent of the required infrastructure (testing, databases, security, etc.). For example, this means that testing database accesses can be done thoroughly without a real database.

291 questions
5
votes
2 answers

Where do long running, stateful 'services' fit in DDD?

In more industry or automation related applications (that mostly heavily rely on external components which they have to manage), you'll often end up with the case that the domain contains models which are more than just abstractions from the real…
Acrotygma
  • 2,531
  • 3
  • 27
  • 54
5
votes
1 answer

Generic Repository and Leaky Abstraction

I am implementing a repository pattern. My main reasons for this: To abstract client code away from persistence specifics (Entity Framework) To support testability Generic Repository or not? The issue I have run into is whether I should have a…
5
votes
3 answers

Onion Architecture - Service Layer Responsibility

I am learning Onion Architecture by Jeffrey Palermo for more than 2 weeks now. I have created a test project by following this tutorial. While studying I came across this question on SO. According to accepted answer, one person nwang suggests that…
5
votes
2 answers

Onion Architecture- Entity Framework Code First Models DataAnnotations

I am developing a ASP.NET MVC Project following the Onion Architecture. I have added the Models inside my Core Project and these Models will be referred as the POCO classes for the Entity Framework Models in the Infrastructure Project. My question…
Saanch
  • 1,814
  • 1
  • 24
  • 38
4
votes
2 answers

Jpa Entity as Domain Model

As per recommended practices documented for DDD or Hexagonal architecture - The domain Model should be separate from the data model representations that are more tied with actual technology used( table/column names, joins, etc, JPA annotation). A…
4
votes
2 answers

Understanding the difference between ONION and N-Layered architecture

I am making the structure of a .Net based application. For now, I am using MVC 5. Here are details of different components of the system. 1. Database – This is underlying database and will contain the data 2. OData API – This API will interact…
4
votes
2 answers

How to use ASP.NET Identity with Onion Architecture?

I'm working on a web and mobile application for a taxi company and I use React.js and React-native for the front-end as well as ASP.NET Core for the back-end. I try to follow the onion architecture to build the web api but I have a problem for this…
user9604344
4
votes
2 answers

what is the difference between use dbset and mappers in EF7

I started to work with .net core and Entityframework 7 in Onion Architecture! i readed this tutorial and i think its best case for learning following subject. but one part of this tutorial made a big question inside my brain. like what you see at…
4
votes
1 answer

DDD: Is it ok to generate/update my entities classes from changes in database schema?

Some time ago, at work, we had to change our main system to be "cross-rdbms". I'm not sure if this is the correct term, but basically the system worked only with MSSQLServer but in order to acomodate a new client we had to make it possible for the…
4
votes
1 answer

Modeling Use Case on Uncle Bob's Clean Architecture

Considering Uncle Bob's Clean Architecture (or Onion Architecture) I have the following scenario: I want to show the user, information of a place: name, category, coordinate. I also want on the same screen, a button, that when clicked, redirects to…
Rodrigo Ruiz
  • 4,248
  • 6
  • 43
  • 75
4
votes
1 answer

Proper Architecture: Adding Attributes to Domain Model in .NET

Background I like Jeffrey Palermo's Onion Architecture model (similar to Hexagonal Architecture) which prescribes that the Domain Model be at the 'center' and the concrete implementations of infrastructure, specifically Concrete Repositories be on…
Philip Pittle
  • 11,821
  • 8
  • 59
  • 123
4
votes
2 answers

Onion Architecture: Core vs Domain

I study Onion Architecture for quite sometime now, I've analysed few sample VS's solutions and still can't understand the difference between Core and Domain in Onion Architecture. In this solution Core (project) is inside Domain (solution…
Kesi Sparks
  • 63
  • 1
  • 9
4
votes
1 answer

Onion-hexagonal architecture dependency confusion

I have problem with understanding the meaning of dependency in hexagonal(port-adapter) architecture. Here they have nice picture. What I don't see is what is the difference(implementation) from n-layer structure. In onion/hex architecture the inner…
Zveratko
  • 2,663
  • 6
  • 35
  • 64
4
votes
1 answer

Consuming multiple APIs and WebServices using the onion architecture

I currently am setup up a Visual Studio solution using the onion architecture. I have a pretty good understanding on how to structure the solution but I am running into a bit of a pickle. My solution is consuming multiple APIs. These API's are…
Thomas
  • 5,888
  • 7
  • 44
  • 83
4
votes
1 answer

Fluent NHibernate and NLog

I'm having issues with some vague errors popping out of my fluent configuration. I have read that setting up a logging solution will help me zero in on the issue. I would like to use NLog. I understand that I need to use Common.Logging 2.0 and…
Tyler Wright
  • 795
  • 1
  • 9
  • 28