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

Implementation of domain services

I'm currently working on a project that heavily relies on external components - mostly physical devices such as routers, switches, NVTs and their respecitive protocols to communicate with (SNMP, Ping, RTSP...). I need to surveillance those devices…
Acrotygma
  • 2,531
  • 3
  • 27
  • 54
0
votes
2 answers

Non-domain service interfaces

While learning domain driven design, I have been putting together the following solution (note that this ordering is lexicographic and not a representation of dependency): Below is an outline of each project: Domain.Models: Domain entities and…
0
votes
1 answer

Breaking the "ubiquitous language" by having an IoC in Domain Model?

My question is about Udi's solution to domain events, particularly the class DomainEvents (see code below) An excerpt from Udi's code. It lives domain model as a static class. public static class DomainEvents { [ThreadStatic] //so that each…
0
votes
2 answers

Mapping a Domain Model to the database with EF Fluent API

Below is the Project code-first class mapped directly to the database through the Entity Framework 6 Fluent API: public class Project { public Project() {} public int ProjectId { get; set; } public string Name { get; set; } …
0
votes
1 answer

Onion Architecture for Modernization

I am working on a big modernization of .NET client server app. I am planning to apply "Onion Architecture" as i feel it is matching the modernization approach that future architecture is not yet finalized. Anybody used Onion Architecture for legacy…
Rajan R.G
  • 825
  • 1
  • 7
  • 10
0
votes
1 answer

Where do I put interfaces and their implementation?

I have the project layout per illustration above. I would like to write a "SesisonManager" with an interface ISessionManager, wire it up using my container and inject it into my service layer. The UI and Infrastructure layers are the outermost…
DfwForSale
  • 374
  • 2
  • 10
0
votes
1 answer

Domain or application layer for some classes in DDD

I am working on a project using DDD, I have some classes and I don't know where to put them. The domain is about an existing game. This game has basic concepts, like Character, SkillTree. My domain class simply represent those concepts. I did not…
David Khuu
  • 937
  • 3
  • 10
  • 21
0
votes
1 answer

Converting to IoC, how to handle inner objects

I've looked through a number of threads here (perhaps I'm using the wrong terminology), but I'm converting a Web Application over to use IoC via NInject. My other IoC projects were fairly small so it wasn't a big issue, but what is the recommended…
Eric J Fisher
  • 324
  • 1
  • 6
  • 14
0
votes
2 answers

Should we expose IDataContext in an Onion architecture

When implementing a Onion architecture in ASP.NET MVC, it is my understanding that we should/could expose the IDataContext interface, which can be injected and referred to in the UI. So basically in ASP.NET MVC, we could…
hyankov
  • 4,049
  • 1
  • 29
  • 46
0
votes
1 answer

How to use dynamic module loading in an onion architecture using MVC4 as frontend

I'm trying to wrap my head around dependency injection in the Onion Architecture, I've found this solution which uses a dependency resolution layer around the onion. But there is so much going on that I'm completely lost. So I setup a project to try…
Snæbjørn
  • 10,322
  • 14
  • 65
  • 124
0
votes
2 answers

Onion architecture for middle tier/backend services

I am currently working on Onion Architecture from J.Palermo. I have some trouble in implementing it in my case. Is this architecture appropriate for 'business less' web sites, aka mashup of services ? Here is my case : We have many backend services…
Cybermaxs
  • 24,378
  • 8
  • 83
  • 112
0
votes
2 answers

Where should I hash my password in a DDD based architecture (Onion Architecture)?

I'm trying to figure out the best place to hash my password for Authentication in my architecture. This is my request flow: MVC3->MembershipProvider->AccountService->UserRepository->NHibernate->Database I'm torn between hashing at the service level…
-1
votes
1 answer

What problem of Layer Architecture really solve Onion Architecture?

I have read several articles about onion architecture and they all point to the fact that the problem of layer architecture is that changes in the database would impact the services layer, but, why would that be so if the connection between both…
-1
votes
1 answer

NUnit tests failed with FLuentValidation in ONion Architecture

Im trying to implement nunit tests with fluentvalidations, but it shows me a failed test and the message: FluentValidation.AsyncValidatorInvokedSynchronouslyException : Validator "AddVehicleCommandValidator" contains asynchronous rules but was…
-1
votes
1 answer

Onion Architecture : Where to put Factories Implementations?

I'm coming to build new "Enterprise solution" So i decided to use "Onion Architecture" because i wanna as much as flexible architecture. But I'm new to "Dependency Resolution" concern. As I understand I should put Factories "Implementations" in this…
1 2 3
19
20