Byteart retail V3-brand new enterprise application practices for. NET and domain-driven design

Source: Internet
Author: User

After more than a month of hard work, I used my spare time to recreate the byteart retail case on the basis of V2, so that V3 came into attention with a brand new look. net enterprise-level architecture and field-driven design. Compared with the previous two versions, V3 has made great progress in both the interface, business, and even technology aspects. Although the system has been improved a lot, after all, I have no way to devote all my time and energy to this open-source project. So V3 certainly has many defects, so I hope my friends can understand it, if you encounter problems, you can try to solve them by yourself. I think this will be of great help to you. If you cannot solve the problem, or have good ideas and suggestions, please leave a message here to contact me. If you are not familiar with byteart retail, you can click the following link to learn more about the first two versions, some related design ideas and architecture views. I will not repeat them here.

《Entityframework-Based Domain-driven design practices [continued]: Use Cases of domain-driven design practices based on EF 4.3.1 code first"

《Byteart retail v2-Case Study of domain-driven design based on Entity Framework code first"

Case source code download

Please 【Click here] Download all source code and Visual Studio 2012 solution files (ZIP package) in this case ). Many of my friends suggested that I transfer this case to a repository similar to codeplex or GitHub. Due to the time relationship, I have not been able to transfer it to these websites yet, therefore, V3 is still provided to you by downloading the zip package. I strive to add it to codeplex or GitHub in the subsequent development process.

Prerequisites

In this case, Visual Studio 2012 is used for development from V3. Therefore, to compile the source code program in this case, you must first install Visual Studio 2012. Because the database uses SQL Server express localdb, you must install these components correctly (if Visual Studio 2012 is fully installed, you can ignore the installation of localdb ). In addition, you do not need to install other components.

Compile and run

Decompress the downloaded byteartretail_v3.zip file to a local disk directory, and then open byteartretail in Microsoft Visual Studio 2012. SLN file, and then byteartretail. after the web project is set to start a project, press F5 (or debug-> start debugging menu item) to run this case. Note:

  1. If you do not want to start this case in debug mode, you need to first expand byteartretail. services Project, select one of them. SVC service file (such as userservice. SVC) then right-click the view in browser menu to start ASP on the server. net Development Server; and then directly start byteartretail. WEB Project
  2. Because the byteart retail V3 database uses SQL Server 2012 express localdb (default instance), when the program connects to the localdb database, localdb needs to create/initialize the database instance, therefore, a database connection timeout exception may occur during the first startup. If such a problem occurs, please wait for a moment and try again. The question is described on msdn:
    The first time a user on a computer tries to connect to localdb, the automatic instance must be both created and started. the extra time for the instance to be created can cause the connection attempt to fail with a timeout message. when this happens, wait a few seconds to let the creation process complete, and then connect again.

  3. If you run byteartretail in the method described above. when a web project has an error related to the WCF binding, this indicates that the WCF Service is not fully started. Restart byteartretail. services project, and then start byteartretail. WEB Project
Logon account

After successful startup, you can click the "login" link in the upper-right corner of the page to log on to your account. Default logon accounts are available (User Name/password ):

  • Admin/admin: Log On As an administrator and manage the site.
  • Sales/sales: you can log on as a salesperson to view the order information in the system and perform shipping and other operations.
  • Buyer/buyer: you can log on as a purchaser to manage product categories and product information.
  • Daxnet/daxnet: A Common User role, which cannot manage the system.
Solution Structure

Byteartretail. sln contains the following items:

  • Byteartretail. Design: contains some design-related image files for reference only and has no practical significance.
  • Byteartretail. Application: Application Layer
  • Byteartretail. dataobjects: Data Transmission object and its type Extension
  • Byteartretail. Domain: Domain Layer
  • Byteartretail. domain. repositories: specific implementation of warehousing (currently based on implementation of Entity Framework 5.0)
  • Byteartretail. Infrastructure: Infrastructure Layer
  • Byteartretail. Infrastructure. Caching: cache implementation at the infrastructure layer
  • Byteartretail. servicecontracts: a WCF-based service contract
  • Byteartretail. Services: WCF Service
  • Byteartretail. Web: ASP. net mvc-based website Program (presentation layer)

The dependencies between projects are as follows:

Improved content

Compared with the previous version, V3 has more new features in terms of business and some technical improvements.

Business
  1. Added the product category function to enrich the original product category division.
  2. Added the user role function.
  3. Added product information maintenance Function
  4. Added the special item feature.
  5. Improved order status
  6. Optimized the interface effect and improved user experience (menus, pages, etc)
Technical aspects
  1. Using channelfactory to implement WCF calls replaces the original method of directly using service reference and prepares for subsequent WCF authentication and authorization.
  2. Add configuration nodes related to byteart retail to the configuration file, including paging settings and role ing information.
  3. Introduce the cache mechanism through AOP interception, and use patterns & Practices Enterprise Library caching Application Block to provide data cache mechanism for the WCF Service. In future version updates, appfabric cache will be introduced as a cache supplier.
  4. Updated the repository interface definition and implemented the Entity Framework-based paging function.
  5. Demonstrate how Entity Framework 5.0 supports enumeration (Enum) Types
Summary

For the time relationship, I would like to introduce such content in detail in a series of articles in terms of technical details, and strive to be able to cover every corner of the byteart retail project. The byteart retail case will continue to develop, and new content will be added both in terms of business and technology. Based on your suggestions, I will release it to codeplex earlier so that you can keep track of the project status in this case at any time.

In fact, when you do these jobs, you may have to put a lot of pressure on the one hand, sometimes there will be a lot of work, of course, you need to put the work at the first place; on the other hand, from the pressure of life, some people around me will think that I have no benefit in doing these things. Let's talk about your feelings here. Although there are a lot of technical experts in China and they are doing a lot better than our technology, there is still a certain gap between our software technology level and some international countries. Of course, "Environmental Factors" should be put aside for the moment, and "Domestic level" and "International Level" analysis should also be put aside first. Let's talk about what we can do, and I don't expect myself to bring much change to the current "status quo" because I have limited self-knowledge, but I think I can do something, or it can have some impact on others. Taking what I do in my community blog as an example, what I do may affect others, for example, helping some friends avoid detours, or helping others clarify their ideas for solving problems, I think this is good. If you exist in the world, you have an impact on it, which is also an achievement. In fact, what you can do in your life is limited. The key is to stick to it. Finally, I would like to thank my friends who have supported me.

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.