The business logic layer is the application brain
Responsible for handling the core business of the system,
- Modeling user-defined processes,
- Responsible for communications between the data access layer and the presentation layer,
- It cannot be changed because of database changes or terminal changes.
The specific implementation of the business logic layer is as follows:
BLL-business logic
Business logic operations, including business processing, calling data access, transactions, etc.
IBLL -- business interface
Interface and service contract exposed by methods in the business logic layer
WFActivitys -- workflow activity Layer
Defines the activities used in the workflow
Minimum logical unit of the business
Because both the service layer and the presentation layer call the business logic layer, it is reasonable to handle transactions, exceptions, and concurrency at this layer.
First, reference the "TransactionScope class
It is difficult to update A record. Assume that A record is read by both A and B and is being modified. A is modified and saved first. When B is saved again, B fails to save because of inconsistent timestamps (because A saves and modifies timestamps before. Adding a Timestamp field to a table can effectively solve the database concurrency problem.
We agree
Place the basic classes required by the system in the "Framework" folder.
- Put all the business-related classes in the self-created folders. The classes adopt the Division class method, which effectively prevents the risk of re-generating and overwriting code, such as: "DiaoYan"
- Transaction, exception, and concurrency processing at this layer
- The method exposed externally must inherit the interface of the IBLL project.
We have completed the design of the business logic layer. For code implementation of this architecture, see www.langben.com.