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
3 answers

Having irrelevant extra parameters and DTO to impelememt IRepository in Domain layer

I have a solution that I have implemented by Onion architecture and DDD like eShopOnContainers. But I have an issue to do this, so I decided share it with you. I try to explain it by an example. You suppose I have a interface that named…
0
votes
0 answers

Onion Architecture - What should an Interface do if has some Data to check after giving structured data (p.ex : an Object) to a Usecase

I have a REST API based on Onion Architecture. But I have some challenges to apply this way of building a server. Concretely with what should be the behaviour of an Interface if has some data to check before giving structured data to a Usecase.…
0
votes
1 answer

Dependencies Rule in Onion Architecture is confusing

In the Onion Architecture, the dependencies rule is outside-in, the arrow means outer layer depends on under layer as following image: In real world, just assume we have projects are structured like this: Project.DomainEntities…
Steve Lam
  • 979
  • 1
  • 17
  • 40
0
votes
1 answer

AspNet WebApi + Angular 7 Project Architecture

I am creating an asp .net core web api + angular 7 project from the scratch. After searching a lot, I couldn't find any document related to onion architecture to build the architecture design. Could someone provide any link to create the…
Jebin
  • 163
  • 2
  • 11
0
votes
1 answer

Onion Pattern .Net Core Related Entities

I'm trying to understand Onion architecture pattern in .net core. Given the Github example project below, how would you include related entities? For example, in the GamesController, how would you also return the related platform entities? Since…
Nathan
  • 11
  • 2
0
votes
3 answers

How to Group IQueryable Method

I want to group List to avoid recurrence records in screen I want to have inner join with SiteToEmp which need to be grouded As i have an IQueryable Method Which return list from data base another table (SiteToEmp )have relation that can record…
shima
  • 49
  • 8
0
votes
1 answer

Onion architecture - Can everyone layer access every interface (breaking the layer dependencies)?

I've been studying and implementing the pattern refered to as Onion Architecture (http://jeffreypalermo.com/blog/the-onion-architecture-part-3/). One thing that makes me question if I understand correctly is the following: All interfaces are defined…
0
votes
1 answer

MVC Asp.Net with Onion Architecture Not publishing Library Projects Dlls.

I have a Solution that contains a UI Appliction -> contains UI & References Core Proj Core Project -> contains Domain Models and References Nothing Infastructure -> Contains Unity Bootstrapper Proj and DAL Proj. Bootstrapper -> contains…
Joe Ricklefs
  • 584
  • 4
  • 24
0
votes
1 answer

How to implement infrastructure Service in Cqrs Architecture?

I intend to implement Infrastructure services in a project that uses the CQRS architecture. The key point is that we are going to cache the Infrastructure service data in this project. And finally, use this data in command and also for the…
0
votes
0 answers

Throwing Rest Exceptions in my Application Services vs adding extra logic to my controller to determine if I need to reply with a 404

Im struggling with two ways to return a HttpStatusCode.NotFound (and other Http Status Codes). 1.) My app service will throw a RestException(HttpStatusCode code) which is caught by Middleware and then a proper response is sent back and the response…
Victorio Berra
  • 2,760
  • 2
  • 28
  • 53
0
votes
1 answer

Naked objects pattern vs Onion architecture

I am getting more into understanding Domain Driven Design and a bit confused about how Naked Objects Pattern and Onion Architecture could relate to each other? Individually how they relate to DDD is quite clear, but is it also possible to relate…
Thinker
  • 5,326
  • 13
  • 61
  • 137
0
votes
1 answer

Onion Architecture - Choosing the right "module" approach

I've been studying the Onion Architecture for a couple of weeks now and I've stumbled across a technical dealema. When I say "module" notice that I'm referring to a notion of project. To be more clear it's compatible to: module = .NET Assembly/Java…
0
votes
1 answer

Autofac WebForms in Onion Architecture

I am following onion architecture whose Bootstrapper part is build with Autofac. Architecture is as follows: Core DependencyInjection (Autofac is here) Service Presentation (MVC 5) Test I needed some WebForm.aspx pages to show my reports. so I am…
Usman Khalid
  • 3,032
  • 9
  • 41
  • 66
0
votes
1 answer

Entity Framework configuration file compilation error

I am using Entity Framework and an onion architecture to make my website maintainable and persistent. Now as I followed a particular onion architecture example, I ended up with: Domain (entities, and domain interfaces) Repository (IRepo, and Repo…
Flexabust Bergson
  • 732
  • 14
  • 34
0
votes
1 answer

MongoDB with Ninject: Resolving Dependencies From Repository

OK so i think i have a fundamental gap on how Ninject works across assemblies that i'm hoping someone can help me on. I have a asp.net mvc website that references a Core.dll which contains my domain objects and my repository and some services. My…
Stringer Bell
  • 265
  • 1
  • 4
  • 13