The driving design practice of DDD domain: How to extract the model

Source: Internet
Author: User

Requirements Description:

Provincial users can register national indicators

User and City level users can register index decomposition

Registration of national indicators, the need to enter the following data: indicator batch, text number, area, here omitted other data, the same below

Registration index decomposition, the need to enter the following data: Index batches, text number, area, and can select multiple cities (city-level registration is the county) indicators, each city (county) indicators are to input batches, text number, area

When a registration metric is decomposed, one metric batch cannot select multiple identical cities (counties)

When the registration index is decomposed, it is necessary to judge whether the current remaining area is enough, for example, when the province registers, it is necessary to see whether the indicator area issued by the state this year is larger than that of the province this year, and the registration of national indicators does not need this judgment

Index after registration, need to be issued, issued, the corresponding city and county can see the data

The state issued to the province, save to the province and the city, the city issued to the city and counties, counties can not be issued, can only view the data issued by the city

Below issued to subordinate of the index, issued to this level called reserve indicators

Each registration year is in the current year

Each registration must generate a project number, the rule for the 100001+ Canton + 6-bit serial number

Extract Domain Model:

Here we omit those tall modeling, what common language, directly into the topic, want is a reasonable model, no matter how to extract, how to abstract out, is to a result

The following is the model I extracted, English is too bad, so the name looks very uncomfortable, welcome to Pat Bricks

<summary>///Indicator Entity///</summary> public class Indicators {///<summary>
        ID///</summary> public string ID {get; protected set;}
        <summary>///Project number///</summary> public string numbers {get; set;}
        <summary>///Area///</summary> public decimal areas {get; set;}
        <summary>///Batch///</summary> public decimal Batch {get; set;}
        <summary>//////</summary> public decimal documentnumber {get; set;} <summary>///issued///</summary> public decimal subdocumentnumber {get; set;
        ///<summary>///years///</summary> public int year {get; set;} <summary>///The current user's administrative code///&LT;/SUMMARY&GT
             
    public string Citycode {get; set;} }

Model Description:

Class naming with indicators should be no problem, directly using the "metric" translation

In practice, there is no need for level two, although it seems that each registration index decomposition, you need to enter a set of indicators and a number of issued indicators, but they have no relationship with the structure, but only to reference the same batch constitutes a whole

This column more highlights: http://www.bianceng.cnhttp://www.bianceng.cn/Programming/project/

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.