High performance IOC plug-in architecture based on. NET MVC
Recently idle, organized the next most recently written code, first write the schema, and then share a few of my own written plugins
Recently, over and over again, the IOC framework chose AUTOFAC for its simplicity and performance, which is the performance test of my major IOC frameworks: http://www.cnblogs.com/gengzhe/p/4370979.html
I'm going to analyze my system architecture:
This is the overall structure diagram, the following is a brief introduction: Sun.core is the core of the system, contains all the necessary components of the system and infrastructure of all the interfaces and necessary expansion classes. Sun.framework is the infrastructure of the entire system, providing the basis for the operation of the system, including the code for plug-in support, which is implemented in this project. Sun.web is the site's entry point. Model is an entity class project. module is a plugin. Operate is a business logic project. The next one introduces, mainly introduces the implementation of the plug-in architecture.
The above two graphs are the core code of the plug-in interface, the previous diagram contains all the IOC container and plug-in interface, the following diagram implements the plug-in interface, and the MVC controller Factory and the view engine classes are rewritten.
Here is the place to store the plug-in, you can put the compiled function plug-in and a separate Web site project copy to the site, the website can automatically retrieve the plug-in when it runs, and load. You can combine all the functions of the website and the content of the website into multiple plugins and then load and run on demand.
I have written here two examples of plug-ins, the above one is based on the Easyui site (plug-in), the following is a Web site to provide a cache of the Redis cache plug-in, after loading the plug-in, the site's cache function is changed to Redis.
This is the plug-in background, the user to develop their own plug-in can use the IOC container to obtain the Sun.core defined function interface, the specific implementation of the function by the corresponding plug-in to achieve
With these two graphs you can see that our cache plugin and website plugin have been loaded successfully.
I will continue to explain to you the specific implementation of the parts.
Category:. NET MVC Tags:. NET MVC plug-in, IOC usage
High performance IOC plug-in architecture based on. NET MVC