According software layered architecture pattern, the basic layer of software from top to down would be Presentation Layer, Business Layer, and Data Layer. Sometimes we might have a special layer called Service Layer that provide the interface(s) to offering different kinds of service(s) for external systems usage.
We could separate and structure our solution:
# Domain project:
##Namespace -> CompanyName.ProjectName.Domain
## Object(s) that stored or passing between each layers(for example retrieved data from database, file or redis…[DTO(Data Transfer Object)], passing the data to business layer(s) and do logic calculation to value object [VO], or return data to presentation layer(s) for rendering the view[Model] to user(s)).
## Interface
## Constants / Enums
# Data Layer: This layer access for the outer storage to forms the single object or collections with objects.
## Namespace -> CompanyName.ProjectName.DataLayer
## Usually we may naming with xxxDAL(data access layer), xxxRespository, xxxEngine.
# Business Layer: The layer created and perform business rule or logic
## Namespace -> CompanyName.ProjectName.BusinessLayer
##Usually we may naming with xxxLogic or xxxBLL(business logic layer)
# Service layer
## Library: internal shared portal
### Namespace -> CompanyName.ProjectName.Library
### Usually we may naming with xxxLibrary or xxxCommons
## Web API: external interface portal
### Namespace -> CompanyName.ProjectName.WebService
### Usually we may naming with xxxController
# Presentation layer
## Namespace -> CompanyName.ProjectName.WebSite
## As traditional MVC project we might have /Models/xxxMode, /Views/xxxView, /Controllers/xxxController
So the basic solutions folders might looks like below:
// DOMAIN
CompanyName.ProjectName.Domain/ Enities/ xxxDTO Interfaces/ IxxxLogic IxxManager IxxxRepository Enums/ xxxEnums Constants// DATA LAYER
CompanyName.ProjectName.DataLayer/ Managers/ xxxManager Repoistorys/ xxxRepoistory Formatters/ xxxConverter// BUSINESS LAYER
CompanyName.ProjectName.BusinessLayer/ Logics/ xxxLogic// LIBRARY
CompanyName.ProjectName.Library/ Hanlders/ xxxHandler Commons/ xxxExtensions Misc/
xxxHelper// WEB SERVICE
CompanyName.ProjectName.WebService Controllers/ xxxControllers// WEBSITE
CompanyName.ProjectName.WebSite Controllers/ xxxControllers Models/ xxxModel Views/ xxx.Html Scripts/ xxx.js Css/ xxx.css Images/ xxx.png Packages/ xxxFramework
The benefit that we sort out the solution before we start our development step:
- The structure were easily to understanding and planning during coding and communication phrase( that means the co-working cost would be reduced as well)
- The well-structured also might avoid the circular project reference problem
- For the maintenance level, the good naming and structure might eliminate the searching cost and if with loose couple design(for each components) that we could reduce the effort for build the new feature or changes on it:)