Many people say that by reading and learning the high-quality code of the gods is one of the quickest ways to improve your skills. I think by reading Nopcommerce source code, can learn a lot of enterprise systems, software development norms and some new technology, skills, can quickly improve our technical capabilities. So I recently decided to write a "Nopcommerce source architecture detailed" series, to detailed analysis of Nopcommerce architecture and principles.
Nopcommerce main use of the technology and characteristics:
1. Entity Framework
2. asp. NET MVC
3. IOC container + Dependency Injection (AUTOFAC)
4. Using entitytypeconfiguration+repository mode in EF + domain-driven development
5. Plug-in technology
6. Themes Theme Technology
7. Ajax
8. Validator Verification Technology
9. Interface-Oriented programming
10, event notification, log mechanism
11. Cache (System.Runtime.Caching.MemoryCache)
12. Site Planning Tasks
13. Message Queuing
14. Multi-lingual support
15. Jquery Ui+kendo UI
16, multi-store support, promotion, online payment
17. SEO Friendly Support
18. Other ASP. NET MVC and C # latest Core Technologies
Nopcommerce is a foreign high-quality open-source website system, the latest version is based on the entity Framework6.0 and MVC5.0, using the Razor template engine, has a strong plug-in mechanism, including payment distribution functions are implemented through plug-ins, based on the multi-language version of XML, very flexible language switching functions, including in the background can also edit the product's English and Chinese properties, very suitable for foreign trade, excellent Advanced program architecture , the performance is also very strong, custom product name and classification has a good SEO optimization. The overall capacity is much higher than some of the domestic programs that are poorly structured. NET marketplace, is the first choice for two development and large-to-consumer architectures. 3.0 started to support multi-store.
Foreground page Effect:
Background Management page:
Nopcommerce the latest version of the source code in CodePlex download.
Nopcommerce mainly from the top down Nop.web, Nop.admin, Nop.Web.Framework, Nop plug-ins, nop.services,
Nop.core, Nop.data. Reference to the third-party module ENTITYFRAMEWORK,AUTOFAC (control inversion, that is, dependency injection), TELERIK.EXTERN.MVC (background management with the interface, after 2.0 to start using).
is a Nopcommerce version 3.4 of the source structure:
1, Libraries
The project under the Libaries folder is mostly public library code.
Nop.core: Encapsulates the underlying core class, interface, to be used by the project. such as domain object classes, cache classes, interfaces, extension methods, and so on.
Nop.Data:EF related to data access related to class encapsulation and extension. The key is that MAPPING,NOP uses the code API to create a mapping between the model and the database table, named "Table name +map". Like what:
- Using System. Data. Entity. Modelconfiguration;
- Using Nop. Core. Domain. Blogs;
- Namespace Nop. Data. Mapping. Blogs
- {
- public partial class blogcommentmap : entitytypeconfiguration <blogcomment>
- {
- public blogcommentmap()
- {
- this. ToTable("blogcomment");
- this. Haskey(pr = PR. Id);
- this. hasrequired(bc = BC. Blogpost)
- . Withmany(bp = BP) . Blogcomments)
- . hasforeignkey(bc = BC. Blogpostid);
- this. Hasrequired(cc = cc. Customer)
- . withmany()
- . Hasforeignkey(cc = cc. CustomerId);
- }
- }
- }
In the future I will explain in detail how this mapping achieves the benefits of doing so at the level.
Nop.services: The real business layer of data processing is through interface-oriented programming to reduce reliance on specific implementations.
2, Plugins
Plugins folder is placed under the plug-in project, you can also follow the rules to develop their own plug-ins.
3, Presentation
Presentation Chinese meaning is the meaning of presentation and expression. That is, the project under this folder is the presentation layer of the solution.
Nop.admin: Background Management
Nop.web: Foreground Web Project
Nop.Web.Framework:Web and MVC-related extensions and public class encapsulation, such as: basecontroller,seo correlation, topic THEMES,AUTOFAC Dependency Injection Dependencyregistrart and so on.
4, Tests
Tests below are the unit tests for the corresponding project.
Nopcommerce Source code Architecture--Initial knowledge of high-performance open-source mall system CMS