Introduction
In the previous article, we provided agileeas. about the implementation principle of The bll layer and the writing method of The bll layer, we can have a deeper understanding and practice in the actual development process, in this article, we will describe the implementation principles of the UI Layer and related
TIPS: there may be a small amount of conflicts with the Environment configuration content described earlier. However, this article describes more principles, this article describes how the resource management platform uses plug-ins + platform ideas to achieve this
Principles and technical details of a resource-based management platform. Of course, due to my lack of in-depth understanding of the agileeas. NET platform, or a certain degree of misunderstanding, there may be errors. Of course, if you have more in-depth
For more information, please criticize and correct.
The agileeas. NET platform uses the Platform + plug-in design idea. The specific UI Layer representation can be simply understood as shown in Figure
Only modules that comply with the plug-in contract can be identified by the Resource Management Platform. Otherwise, the modules cannot be identified and managed by the resource management platform, and the services provided by the container cannot be enjoyed.
Of course, we do not need the resource management tools provided by the agileeas. NET platform. We can directly run the common form as the main form. However, the agileeas. NET platform provides a lot
Some services of the underlying module, such as resource allocation of components, Dynamic Release of objects, object resurrection, and object lifecycle. We need to consider these issues during our own development.
Next we will analyze how to create a new application.ProgramTo use the UI Layer, one way is to customize the resource manager provided by agileeas. NET platform. One is to use this resource manager to manage
Module.
Outline
1. Do not use the resource manager of agileeas. NET platform to build the UI
2. Use the resource manager provided by agileeas. Net to develop the module.
Do not use the Development Interface UI of agileeas. NET platform
Is it agileeas. the resource management platform provided by the. NET platform is used to develop function modules, which means that the user interface we develop here does not need to define the plug-in contract and can directly build an application,
If we want to use the dal and business logic layers we have already written, what should we do at this time? I think this is something that everyone cares about. Next we will build a step-by-step response that does not rely on plug-in contracts.
Application Module.
1. Create a winform application project:
2. Click "OK" to view the solution structure:
3. Rename "from1" to "mainform ":
Next, we will add the BLL layer and Dal layer used in the project and the DLL Assembly reference that these two layers depend on.
4. Drag a panel from the toolbox to store the query condition area, and then drag and drop a panel to display the data space area.
5. Add the following controls. We will add a drop-down list control to display the drug type "drugtype" and add a keyword to retrieve the drug records containing the specified keywords.
6. Let's write specific business logic.
7. Writing query method:
8. For enhanced use, we will execute the query when we enter the "keyword" and press "enter:
9. Through the steps above, we have completed the basic business logic functions. Next we will add a configuration file:
Add the following configuration section to the configuration file:
Click "save" to set the project to start and run "F5:
Enter a keyword to search for the drug, or click query. If the drug type in the stock is "radioactive material", it is displayed:
In this way, we will develop a simple user interface program. Of course, the development of other modules is similar. I will not elaborate on them here.
Use the resource manager provided by agileeas. Net to develop modules
We still create a new module, but this module is accessed through a plug-in. At this time, we have a limit that we need to build a test environment for the plug-in. Otherwise, the plug-in cannot be loaded, for more information about how to build the plug-in test environment, see
Refer to the following articlesArticle.
Example of agileeas. NET platform development-pharmacy system-prepare development environment (I)
Agileeas. NET platform development example-pharmacy system-prepare development environment (medium)
Example of agileeas. NET platform development-pharmacy system-prepare development environment (II)
The previous articles describe how to build the development environment of agileeas. Net and the test environment of plug-ins. Once the environment is set up, the development steps of our modules are as follows? Here I will directly describe specific business development
Process.
1. Create a "winform application". After the application is created, delete the winform1 and program static program storage functions automatically created by the system:
2. Add a reference.
3. Modify the output path of the project:
4. After the configuration is complete, create a new user control to complete the inventory query function module.
5. design the interface:
6. Add the corresponding method, which is exactly the same as that of the previous winform version. I will not list them here. I will only provide key contract descriptions.
7. The final interface effect is as follows:
8. In the test project, modify the DLL configuration of the UI to the application project we just added.
9. the specific content of the modified configuration file is as follows:
10. Run "F5". If the following interface is displayed, the operation is successful.
Enter the password to view the full picture of the resource management platform.
Click "inventory query ":
Click query. Records that meet the query conditions are displayed:
This completes the development of the module. The development of other plug-in modules is also so fast and simple.
Summary
This article analyzes and describes how to develop and analyze the UI Layer, probably because of my limited level, the underlying implementation principle is not profound enough, in the future, we need to explore more deeply. Of course, if you are better
Suggestions and suggestions can be put forward. I will continue to improve. Thank you! In the next article, I will write some tips and Analysis on the design of the business logic in the interface implementation process.
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