Data Modeling and Business Modeling

Source: Internet
Author: User
Tags fsm

 

Whether it is an enterprise information system or a Web site, various sizesProgramThe original functions are data operations. It can be seen that a group's various requirements for some data have created one program after another, or software systems.

Looking back, we started to deal with data from the very beginning. What should we do first when a new project starts? Is a third-party dependency framework used to design the directory structure? No, these are all technical reserves and should be completed before the project starts. When the project is started, we always analyze the data.

We need to analyze the data structure, clarify the Data Relationship, determine the data type, and take into account the size of the data volume. Now, at least we don't need to consider the storage media of the data, because databases are used in all situations, in rare cases, no one should choose to write their own file systems for data storage?

The above steps are called data modeling. The programmers must be very familiar with it. From getting the first form of the user, drag the first table in the ER diagram, we started to design the data model. The designed data model will be solidified in a certain medium (basically databases). The purpose of the application system is to provide users with an interface, let them operate on the data that is solidified in the media (generally databases.

How can this be a good data model? First, it must meet the basic requirements of data solidification. All necessary data must be stored in the database. Second, the structure of the data should be easily operated by applications, functions such as addition, deletion, query, modification, data verification, data security, search and query, statistical summary, and data export can be implemented, and the efficiency cannot be too low. If you can achieve the above two, you can basically be considered a good data model, so that users can use applications to manage and operate the data they need in the database.

But there is another question: is it enough to provide these functions to meet the user's requirements? We can see from the functions listed above that, whether it is crud addition, deletion, query, modification, or query statistics, it is nothing more than "Update" and "query (read )", the three basic operations of "check" are all single-step operations based on static data. Applications simply wrap a thin layer of data, the user is still facing and managing the entire data model.

This problem can be attributed to: We solve what the user wants, but we do not know how the user needs to do it ).

Data Modeling solves the problem of how to store data, how to store the format, and how to obtain the stored data. Data Modeling completes the task of data solidification and retrieval, data Modeling is ultimately a modeling of static data. You can easily understand the data type and Data Relationship by providing an erdiagram, however, you cannot figure out what tasks the customer needs to use from the data format data relationships. It is not clear where and where the data comes from. It determines that the application system you write can only contain one input interface and one query interface, and no more functions can be provided for end users, because you only have static data in your hands.

Therefore, to enable the application system to shoulder more functions, we need to perform business modeling based on the business model, such asArticleThe table structure in the publishing system is as follows:

From the table structure, we can see that an article contains the primary key (ID), author (author), content (content), status (Status), Creation Time (create_time), and modification time (update_time ). The Status field type is integer. The possible values include 0, 1, 2, and 3. In terms of numerical values alone, no one except the tabulation personnel knows what the four States do, but the problem can be solved by working with the flowchart below.

The goal of business modeling is to allow applications to help end users solve problems in their actual business based on the data model, and to change the data flow and status in areas of interest to them, from the above flowchart, we can see that although the status has four states, these four States cannot be converted at will. "Article drafting" (status = 0) it can only be changed to "submit for approval" (status = 1), while "approval completed" (status = 2) cannot be changed as a termination state. These functional requirements cannot be solved in the Data Modeling stage. Only by combing and analyzing the business logic and business processes can these functions be provided to end users in applications.

Business modeling makes data models bloody. Combining business data is no longer a thin skeleton, but a fresh creature.

We have introduced the relationship between data modeling and Business Modeling with the help of the simplest Document approval process. I hope you can learn the relationship between business processes and data models in software development, don't underestimate the status bit in the table structure of the article. It has begun to take shape of the finite state machine (FSM, finite state machine). Many simple workflow engines are implemented based on FSM, you may not use a workflow, but the problems we face and solutions are similar.

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.