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
0
votes
1 answer

Unit Of Work in Generic Repository

I want to move my Unit of work away from my business logic. In Infrastructure.Data I have NHibernateHelper public class NHibernateHelper { private ISessionFactory _sessionFactory; private readonly string _connectionString; public…
0
votes
1 answer

Large scale and full extensable web application architecture

I have been reading many architectures such as N-Layered, Onion ,... . But I'm designing a large system that is working by some huge databases and provides a lots of services to another applications/clients. On the other hand our system have to be…
Ali Adlavaran
  • 3,697
  • 2
  • 23
  • 47
0
votes
2 answers

Database externalization in Onion/Hexagonal architecture

I thinking about writing an app using an onion/hexagonal architecture pattern. I'm stuck on a database externalization. My app need to make some complex data queries to fulfill a use cases. I have two aggregates "A" and "B" and they are related. To…
0
votes
1 answer

Repository OO Design - Multiple Specifications

I have a pretty standard repository interface: public interface IRepository where TDomainEntity : DomainEntity, IAggregateRoot { TDomainEntity Find(Guid id); void Add(TDomainEntity entity); void Update(TDomainEntity…
0
votes
1 answer

Onion Architecture Access Directory and Application Database

I'm a bit stuck on the Onion Architecture. Say I'm developing an application where a user can register an account, log in and maintain their account(E.G. Change Phone Number). However, while they are logged in, they can do other application stuff…
Shane van Wyk
  • 1,870
  • 1
  • 26
  • 62
0
votes
0 answers

Onion Architecture with I18N Database Driven Internationalization

I can't find an answer anywhere really so thought I would post a question about it. I have followed this tutorial ASP.NET MVC 5 Internationalization · How to Store Strings in a Database or Xml Now that is fine and all, I can get it to work. The…
0
votes
1 answer

Refactoring to Domain driven design

I have a scenario am trying to refactor to DDD. I have a Batch which is an aggregate and List of BatchEntries. After a Batch is created and BatchEntries added, an SMS is sent to the individuals in the batch and the status of the batch changes from…
xariez
  • 529
  • 1
  • 5
  • 17
0
votes
1 answer

Authorize with Roles in onion Architecture

hello everyone i have a project where am using ASP.NET Identity 2.0. in this project am following the Onion architecture. the layers are : 1.UI: no reference to Owin or ASP.Net Identity 2.AuthenticationService:contains a wrapper for the asp.net…
0
votes
1 answer

Windows Service with Onion Architecture

All the onion architecture examples I've seen are within the context of ASP.NET MVC apps. They tend to avoid a direct reference between the UI and the service implementations (infrastructure) by putting IoC setup in the infrastructure DLL and using…
0
votes
0 answers

Should the login logic be removed from the controller

I am trying to follow best practice and ensure my controllers lean where the main business logic is performed in a service layer. In my action below I have extracted the Validate Login code to a service layer but am unsure where the logic should go…
Adrian Halid
  • 589
  • 8
  • 17
0
votes
1 answer

Understanding onion architecture

Onion Architecture Mockups Above are two images that depict my understanding of Onion Architecture. They are slightly different from the drawings found online, because they address an agenda that I cannot find an answer to. Infrastructure, as far as…
D.Mistry
  • 22
  • 1
  • 6
0
votes
2 answers

Communicating input & processing errors from service layers

In my project, I have a service layer that manipulates repositories. The service layer is called by my controllers. In many cases, my controller layer is able to validate incoming information before it gets any further into the system. In some…
0
votes
1 answer

Is it bad practice to have a class helper to convert DAL objects to Core objects

I'm struggling to get a good architecture for my current project. It's my fist time designing a serious n-tiers app trying to use the best practices of software engineering (DI, Unit tests, etc...). My project is using the Onion architecture. I have…
tobiak777
  • 3,175
  • 1
  • 32
  • 44
0
votes
1 answer

Did I implement Onion Architecture correct?

This is my first try at implementing the Onion Architecture. AppService -> folder for the abstractions for the entire Application Business -> Business logic using the abstractions in the Core project DataService -> folder for abstractions that are…
Ivan Prodanov
  • 34,634
  • 78
  • 176
  • 248
0
votes
1 answer

Onion Architecture - can different segments of the outer layer depend on each other?

I am trying to refactor the system according to Onion Architecture approach. My outer layer includes the following segments WCF web service (which we provide) infrastructure classes for DB access infrastructure classes to access external web…
Maxim Eliseev
  • 3,248
  • 4
  • 29
  • 35