What Is a Business Logic Layer?
The Business Logic Layer is undoubtedly the part of the system architecture that reflects the core values. Its focus is mainly on system design related to business requirements, such as the formulation of business rules and the realization of business processes, that is, it is related to the domain logic to which the system responds. In many cases, the business logic The layer is called the domain layer.
Business logic layer
- The so-called three-tier development is to divide the entire business application of the system into
- For example, Martin Fowler in the "Patterns of Enterprise Application Architecture" book divides the entire architecture into three main layers: the presentation layer, the domain layer, and the data source layer. As a pioneer of domain-driven design, Eric Evans made a more detailed division of the business logic layer, subdivided into the application layer and the domain layer, and further separated the domain logic from the solution of the domain logic through layering.
- The position of the business logic layer in the architecture is critical. It is in the middle of the data access layer and the presentation layer, and plays a role in the data exchange. Because the layer is a weakly coupled structure, the dependencies between layers are downward, and the bottom layer is "ignorant" to the upper layer. Changing the design of the upper layer has no effect on the bottom layer it calls. If the idea of interface-oriented design is followed in layered design, then this downward dependency should also be a weak dependency. Therefore, without changing the interface definition, the ideal layered architecture should be an extractable and replaceable "drawer" architecture. Because of this, the design of the business logic layer is particularly critical for an architecture that supports scalability, as it plays two different roles. For the data access layer, it is the caller; for the presentation layer, it is the callee. Dependency and dependent relationship are entangled in the business logic layer. How to achieve the decoupling of the dependency relationship is a task left to the designer in addition to implementing the business logic.