Practice-business logic layer

Source: Internet
Author: User

The business logic layer is the application brain

    Responsible for handling the core business of the system,
  1. Modeling user-defined processes,
  2. Responsible for communications between the data access layer and the presentation layer,
  3. 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.

  • Use of transactions

First, reference the "TransactionScope class

  • Exception Handling

  • Concurrent processing

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.
  1. 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"

  2. Transaction, exception, and concurrency processing at this layer
  3. 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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.