aspnetboilerplate / aspnetboilerplate

ASP.NET Boilerplate - Web Application Framework
https://aspnetboilerplate.com
MIT License
11.8k stars 3.79k forks source link

Simple architectural picture needed #1505

Closed papyr closed 6 years ago

papyr commented 7 years ago

Hello, it would be nice to have a simple picture similar to this, where we know which boxes are mandatory.

I am working on simplifying the patterns.

-Papi

natiki commented 7 years ago

Hi Papi,

http://www.aspnetboilerplate.com/Pages/Documents/NLayer-Architecture is worth a read and there is also the http://www.codeproject.com/Articles/768664/Introduction-to-ASP-NET-Boilerplate which provides some context.

HTH's

papyr commented 7 years ago

Thank man, I have been reading this. Its chunked up and I have like 10 sheets printed on the floor to understand this 😆 BTW I am now follower you hahahaha

drakkewrn commented 7 years ago

I'm using ASP .NET MVC, and I have both controllers and application services (I don't use fornt-end framework).

Should my controllers use application services? Logic should be in my controllers or in my application services?

Is it "legit" or "normal" to put some logic inside my controller, or these should only call application services?

natiki commented 7 years ago

Placing the logic in your controllers is generally not a good idea. It means code re-use is low and code complexity goes up. Generally your logic should be in your application layer.

The reason for this is that you can call it from your Web/Presentation layer(s) ie MVC, WebApi and the logic is all in one place. Also say you wanted to add Angualar front end then you call your application layer and things "just work".

There is also another school of thought that you should use a mediator patter to further keep your presentation layer thinner. You can have a read of:

The key here is:

  1. ABP is very good at providing you enough entry points to do what you need without getting in your way. It balances up keeping itself "on message" in trying not to do everything.
  2. You need to look at what works for your situation. I work across a number of teams and each of them has approached things differently for what they need while using ABP. Normally this means additional wrappers and class descendants off key ABP classes and approaches to fit in with their work flows.
papyr commented 6 years ago

Hi, When will an architectural picture be put up?

alirizaadiyahsi commented 6 years ago

Hi @papyr,

There is the pic in readme file. https://github.com/aspnetboilerplate/aspnetboilerplate