Sorry, in my own html "> ". net briefly talks about the idea of layered architecture (completely separated from each layer) "The lack of sample code in this article makes it inconvenient for everyone to understand, and the younger brother will lose the money first; in this article, I will add all the code that implements a thorough hierarchy.
The advantage of thorough layering is that the workload of each person can be reasonably allocated. For example, some people in a project team may prefer uidesign and development, while others may prefer business logic writing, people familiar with the company's core business do not need to manage the implementation methods of the UI Layer and business layer, as long as the code of the data access layer is implemented for the upper layer to call; in my own project, in order to completely separate all implementations, development is both technical and business requirements. The project is probably like this: I do not know whether the storage does not exist for all implementations, I do not know where the implemented project or the Assembly (dll) file is, so I only need to publish an implementation interface for others to implement. I call the relevant implementation code through the interface; the reflection code above is the most critical implementation. Please refer to my project structure:
In my project, it is fully implemented according to the layered architecture (vertical and horizontal layers); There is a main program Hz. dataGather. main, this project is all the interface layers, that is, the UI Layer. For the UI Layer, I don't need to know where all the objects implementing functions are. I just need to call them through interfaces, see the figure below:
I only need to use the BLL layer interface to call the UI Layer, and pass the interface type as a parameter to the BLL factory. Please refer to the BLL layer Factory Code diagram:
It must be noted that: Assembly. the LoadFrom () parameter name needs to be dynamically filled, and the name here needs to be documented; this effectively achieves layer-by-layer separation, even in the development phase, each layer of the project can be removed from the solution and dynamically added. Similarly, the DAL layer is also the case. Finally, it will come to the UI Layer:
The interface events can be accurately associated with the status changes of the instance. We hope this part of code can help you understand. If you have any problems, please point out