Original link: http://docs.nopcommerce.com/pages/viewpage.action?pageId=1442491
Translation By:yersans, if there is inappropriate, please correct me, bo main mailbox: [email protected]. Reprint please indicate the source.
This article is about Nopcommerce Developer's Guide to the solution design structure. If you are a nopcommerce Novice Developer, reading this article can help you to have a basic understanding of Nopcommerce's source code. First of all, you can easily get nopcommerce Source code, it is an open source project, you only need to download from the nopcommerce official website. Open the project solution with Visual Studio , with its organizational structure as so. We recommend that you use Visual Studio to Open and explore the relevant files for your solution while you are reading this article.
Most project files and folders in the scenario are properly named so that you can take a rough impression of their functionality. For example, I don't need to look at the specifics of the Nop.Plugin.Payments.PayPalStandard project to guess what it is for.
\libraries\nop.core
The Nop.core project file contains the core classes of Nopcommerce , such as caches, events, and business objects (for example,Order and Customer entity).
\libraries\nop.data
Nop.dataproject file contains database read-writeRelated classes and functions. We use this to separate the data access logic from the business object.NopcommerceUseEntity Framework (EF) Code-firstfor database access. It allows you to define entities in the source code (all core entities are defined inNop.coreproject file). After that, you can useLINQquery the object,LINQstatements are translated in the background toSQLstatement and execute against the databaseRelated operations.nopcommercesUnified UseFluent APIfor entity mapping. You can clickThe following connection pairsCode-firstto do further understanding.
Http://weblogs.asp.net/scottgu/archive/2010/07/16/code-first-development-with-entity-framework-4.aspx
Http://blogs.msdn.com/b/adonet/archive/2011/03/15/ef-4-1-code-first-walkthrough.aspx
\libraries\nop.services
The Nop.services project file contains core services, business logic, and the necessary validation and operations related to data. the so-called business logic layer.
Items under the \plugins\ folder
\plugins is a solution folder that stores various plug-in projects. Its physical path is in the root directory of the solution. because the build output path for all plug-in projects is set to ". \.. \presentation\nop.web\plugins\{group}. {name}\ ", so the DLL for each plugin is automatically copied to the \presentation\nop.web\plugins\ folder, It is used to store those plugins that have been released. This allows the plug-in to include some external files, such as some static content (CSS or JS files), without having to copy between projects to function properly.
\presentation\nop.admin
Nop.admin is an MVC site project, and if you haven't used ASP. NET MVC before, you can click http://www.asp.net/ MVC Learn more about the content. As you expected, it is the management functional area of the presentation layer. Its physical path is \presentation\nop.web\administration. This project cannot be run directly.
\presentation\nop.web
Nop.web is also an MVC site project , which is the presentation layer of the marketplace, the actual runtime project and the startup project for the entire solution.
\presentation\nop.web.framework
Nop.Web.Framework is a class library project that contains some of the nop.admin and nop.web Common presentation- related content.
\test\nop.core.tests
Nop.Core.Tests is a test Project for the Nop.core project
\test\nop.data.tests
Nop.Data.Tests is a test Project for Nop.data.
\test\nop.services.tests
Nop.Services.Tests is a test Project for the Nop.services project
\test\nop.tests
Nop.tests is a class library project that contains the common test classes and helper classes that are required for some other projects, and it does not contain any test code.
\test\nop.web.mvc.tests
Nop.Web.MVC.Tests is a test project for the presentation layer project.
Nopcommerce Developer's Guide (i): Nopcommerce source code structure