High performance IOC plug-in architecture based on. NET MVC

Source: Internet
Author: User
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

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.