Mani
Controller-Service architecture. What is service?
@ВОСТОЧНЫЙ КАЛИМАНТАН the core concept is you follow single responsibility principle. Controller Or yourweb project to deal with Http, authentication,caching, configuration etc (it is basically a host for your business logic).
Then create a project for you business process (eg: UserService, OrderService, CheckoutService)
finally create a infrastructure project to deal with external dependencies (eg:DB, cache server, Payment gateway api)
The idea is you can change the host anytime (API, or MVC pages application, Desktop application)
Same way you can also change the infra (i.e. change SQL to cosmos db, or switching to new payment gateway). Changing host or infra will not impact your business logic.
this is just a basic setup, you can extend or trim based on your need. Don't spend to much time on this, there are some good templates you can use it. https://github.com/ardalis/CleanArchitecture
6 replies