onion-architecture

Onion Architecture and Registering Dependencies in DI Container

我是研究僧i 提交于 2019-12-05 04:35:19
问题 I have been reading up on the Onion architecture, and I have what I think is a simple question about how assembly dependencies should be arranged for a DI container to be able to wire everything up. Assume a very simple solution that has the following structure: UI => BL <= DAL So the UI and DAL reference the BL, but have no knowledge of each other. Also assume the BL has an interface called IDatabaseService, which is implemented in the DAL by DALDatabaseService. The container would

Onion Architecture - Service Layer Responsibility

偶尔善良 提交于 2019-12-05 01:34:32
问题 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 Methods like GetProductsByCategoryId should not be in Repository and one the other hand Dennis Traub suggests that it is the responsibility of the Repository. What I am doing is : I have a General Repository in Domain.Interface in which I have a

EF6 and Onion architecture - database first and without Repository pattern

◇◆丶佛笑我妖孽 提交于 2019-12-04 18:12:39
I'm trying to put it all together for an new architecture for existing application. Existing application has a lot of business logic, so I thought that Onion architecture (or something like that - layered, decoupled) could be the right solution - http://jeffreypalermo.com/blog/the-onion-architecture-part-1/ All examples that I have seen use Repo/UoW (on top or ORM) pattern in Infrastructure layer (or DAL, or whatever the layer that actually connects to database is called). But I'm not sure that in my case Repo/UoW (on top of EF) is necessary, because: EF6 can be nicely Unit Tested without Repo

what is the difference between use dbset and mappers in EF7

╄→гoц情女王★ 提交于 2019-12-04 10:47:32
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 this linked page; at Data Layer we have some classes which are our model!! public class User : BaseEntity { public string UserName { get; set; } public string Email { get; set; } public string Password { get; set; } public virtual UserProfile UserProfile { get; set; } } public class UserProfile : BaseEntity { public string FirstName { get; set; }

Onion architecture compared to hexagonal

独自空忆成欢 提交于 2019-12-04 10:12:43
问题 Is there any difference between them (onion | hexagonal), from my understanding they are just the same, they focus upon the domain which is at the core of the application and should be technology / framework agnostic. What are the differences between them if any ? Also I see no real advantage on using one over the other or even against an N-layered architecture, if done bad just following any of them won't make any difference What are the benefits of using one over the other and why you would

Does a Generic Repository need a Base Entity class to be applied everywhere?

眉间皱痕 提交于 2019-12-04 02:15:47
问题 I am creating an Intranet website with ASP.NET MVC and Onion Architecture . I have been implementing the repository pattern but I have a difficulty. Let's say I have a Document table with IDDocument in it. Then this is my repo(with just one method): class Repository<T> : IRepository<T> where T : class { private readonly PrincipalServerContext context; private DbSet<T> entities; //Constructor and stuff here public T Get(long id) { return entities.SingleOrDefault(s => s.IDDocument == id);//Here

Setting the identity of a Domain Entity

十年热恋 提交于 2019-12-03 20:43:01
All entities in the domain need to have identity. By inheriting from DomainEntity , I am able to provide identity to classes. City domain entity (stripped down for easy reading): public class City : DomainEntity, IAggregateRoot { public string Name { get; private set; } public Coordinate Coordinate { get; private set; } public City(string name, decimal latitude, decimal longitude) { Name = name; SetLocation(latitude, longitude); } public City(string name, decimal latitude, decimal longitude, int id) : base(id) { Name = name; Coordinate = coordinate; SetLocation(latitude, longitude); } public

Onion Architecture and Registering Dependencies in DI Container

与世无争的帅哥 提交于 2019-12-03 20:09:09
I have been reading up on the Onion architecture, and I have what I think is a simple question about how assembly dependencies should be arranged for a DI container to be able to wire everything up. Assume a very simple solution that has the following structure: UI => BL <= DAL So the UI and DAL reference the BL, but have no knowledge of each other. Also assume the BL has an interface called IDatabaseService, which is implemented in the DAL by DALDatabaseService. The container would (presumably) be configured in the UI's entry point. Since the UI has no knowledge of the DAL, how can it

Onion architecture compared to hexagonal

人走茶凉 提交于 2019-12-03 05:31:56
Is there any difference between them (onion | hexagonal), from my understanding they are just the same, they focus upon the domain which is at the core of the application and should be technology / framework agnostic. What are the differences between them if any ? Also I see no real advantage on using one over the other or even against an N-layered architecture, if done bad just following any of them won't make any difference What are the benefits of using one over the other and why you would use it ? when to use it? Thanks choquero70 What are the differences between them if any? Onion: There

Onion Architecture

萝らか妹 提交于 2019-12-03 02:22:25
问题 I am setting up a project structure for an upcoming internal application trialling the Onion Architecture proposed by Palermo (http://jeffreypalermo.com/blog/the-onion-architecture-part-3/). I have followed his guidelines, however I need some verification on the structure of the project so far. Before the diagrams, the questions: I think the References are all correct (set up as per the diagram where an arrow means 'has a reference to') but some verification would be good. What should I put