Introduction
In the previous article, we analyzed agileeas. the design of the Dal layer of the. NET platform and relevant instructions for use. In this article, we will analyze the design and analysis of the business logic layer/service layer, and analyze how to extract the separate business logic
Layer to separate independent distributed access service support. We mainly analyze how to design a hierarchical design mode based on The bll-> service layer> UI Layer on the existing Dal layer. The hierarchical design mode adopted by the pharmacy system in this series
The method is dal> BLL layer> UI Layer. Next we will analyze the two different implementation schemes andCodeAnd analyze the writing methods and internal implementation principles supported by the distributed service.
Outline
1. Dal-> BLL layer-> service layer-> UI Layer.
2. Dal-> BLL layer-> UI Layer.
3. Contract analysis supported by distributed access on the agileeas. NET platform.
Dal-> BLL layer-> service layer-> UI Layer
Let's take a look at the implementation scheme that classifies the responsibilities of the business layer and the service layer.
By knowing the responsibilities of each layer in this layered architecture, we will provide a strict division and design description for the responsibilities of each layer:
Since we do not add any content to the Dal layer, we will add the business logic related to this entity to The bll layer. Let's take a look.
With the relevant business logic layer, we can organize some business logic processes at the service layer: we can understand that the service layer controls the appearance layer of the business logic flow through the appearance mode.
To sum up, the service layer is equivalent to a coarse-grained interface of the business logic process. Of course, we transmit data between the service layer and the business logic layer through DTO.
For the organization of the above architecture, I will separately write some cases using this architecture in the subsequent case scenarios and combine them with aigleeas. net.
Dal-> BLL layer-> UI Layer
In this section, we will use the BLL layer to organize the relevant business logic and business processes, for example, the business process management described in the previous article on drug delivery operations.
Describes the responsibilities of the business logic layer:
Let's take a look at the related business logic layer during drug delivery operations:
2. We can see that the writing method in each business logic is not much different from that in normal times. Next we will analyze the internal implementation principles and Usage Analysis:
3. We have not checked how to use transactions to Perform Batch operations? This is also one of the highlights of the agileeas. NET platform. It is very convenient to write batch transaction operations by Delegate.
4. Let's take a look at the specific function definitions and delegate definitions for calling transactions:
Function delegate definition:
Include custom Parameters
Does not contain custom Parameters
5. Definitions of calling transaction execution methods:
6. We have learned how to execute the delegated transaction through the above steps. You can refer to it and implement it by yourself. Of course, there may be better solutions, but I think this is a way of writing, it is relatively good to write.
Distributed access support for the agileeas. NET platform
In this section, we will analyze the principle of implementing distributed access on the agileeas. NET platform. Of course, I may not provide specific implementation code here.
Currently, the platform supports distributed access in the following formats:
Next we will analyze the internal implementation principle of distributed access step by step.
1. Let's analyze the content of this IOC container:
2. view the definition of the service component base class:
This class only defines a contract. All classes that meet this contract can support distributed services.
3. view the "Internal definition of sessionobject"
4. As we know above, the agileeas. NET platform uses marshalbyrefobject to support distributed access. Therefore, we only need to implement the business logic in the business logic layer. Specific usage and
The configuration of distributed services will be detailed in the subsequent application deployment module on how to deploy distributed access.
Summary
This article also analyzes the implementation scheme and principle of distributed access, the specific configuration and how to use distributed services, etc, we will elaborate on the Application Deployment and configuration of the module in the future. Of course
Due to my limited level, or the degree of research on agileeas. NET is not profound, I am not clear about it or understand it. Please criticize and point out it.
Pharmacy system source code
More communication
Official blog: http://www.smarteas.net/
Http://www.agilelab.cn/
If you have any questions about using the agileeas. NET development platform, use the following contact methods or communication methods.
1. Telephone-Email:
He gozhou: hegezhou_hot@163.com mobile phone: 18691480181 blog: http://www.cnblogs.com/hegezhou_hot/
2. QQ chat group:
308961614 Network Name: h.o. t