Store Management System development practices-business logic and System Structure

Source: Internet
Author: User
1. business logic and system structure 1.1. Business Logic

The business logic of the store system mainly includes the following:

  • It is used based on multiple stores.
  • Inventory = purchase warehouse receiving-purchase return-Sales retail + sales return
  • Gross profit = (retail price-purchase price) * retail quantity

The length is limited. Here I just briefly list the common business logic in convenience store management. The details of the complexity are not here.

1.2. System Structure

In this case, the store system adopts a domain-driven design, which consists of four layers: presentation layer, application service layer, domain layer, and infrastructure layer.

The presentation layer consists of Windows Forms and hidden code files. Windows forms only provide user operations and interface layout, while code hidden files enable event handling of various controls.

The application service layer is a WCF Service, mainly to provide external APIs so that external systems can interact and expand with the system through the provided APIs.

The domain layer mainly defines the entity attributes of the business domain;

The infrastructure layer provides specific implementation of repository and ORM for the entire application.

The entire system architecture can be described as follows:

 

It should be noted that the presentation layer (winapp) in is dependent on the repository interface and domain model ). Repository depends on the domain model and repository interfaces. The store system uses dependency injection to inject the repository (repository) into the presentation layer (winapp). Therefore, the presentation layer (winapp) does not depend on the specific implementation method of the repository.

 

Visual Studio 2008Solution Structure

The store system has six projects under the Microsoft Visual Studio 2008 solution: cntosoft. winapp. store, cntosoft. domain. store, cntosoft. services. store, cntosoft. repositories. store, cntosoft. repositories. store. test and cntosoft. library. As follows:

 

  • Cntosoft. winapp. Store: Provides user interfaces and interactive interfaces.
  • Cntosoft. domain. Store: The domain model project, including the domain model and some business logic of the store system, is also the core of this case.
  • Cntosoft. Services. Store: temporarily available.
  • Cntosoft. repositories. Store: The specific implementation project of warehousing. This project only includes the warehousing implementation for nhibernat.
Related Article

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.