System design changes and changes (answer questions about golden ocean)

Source: Internet
Author: User
System design changes and changes (answer questions about golden ocean)

The scope of our discussion is to design database-based applications. There are still many applications that will not be implemented based on databases, so we will not discuss them for the moment,
In the previous discussions on hierarchical design, golden ocean students felt that the hierarchy did not solve the problem of table field changes in the database.Code, Then
I will answer this question with the system changes and changes.

First, modifications to the system code are unavoidable, and the omnipotent component that can be applied to all situations seems to me that such non-Earth species have not yet been found. So
In system design, which changes should not be changed? First, the structure of the system (taking ASP. NET as an example ).

for the database-based application Program , read data as an example, the process of running the entire program can be divided into several stages:
first, obtain parameters from the page-> judgment logic of business logic-> database operation logic (send SQL, obtain the returned dataset)-> business logic judgment-> page display logic.
then we classify these related operations. The obtained parameters and page display logic are obviously implemented on the page or in the page-related class, or someone extends it to other classes through the interface
. We can combine these classes to display the layer. Even if this layer is separated by interfaces and pages, but it is also coupled with the page height
. Similar to aspx pages and Aspx. CS can be counted as content coupling:
for example, you need to add a string to be displayed in the presentation logic (maybe not because columns are added to the data table, it is generated in business logic computing .), In this case, the
page must be modified.
logical judgment classes are all included in the business logic layer. Why do we need the business logic layer? Most of the time on the website, the data is simply read, so this level looks like
, but let's look at it from another place, for example, login and password retrieval
if we register a user and click Register, we will first check whether the user exists and then verify the input. For example, when logging on, we need to verify the username entered in
. Sometimes, it is not just to verify the users in the database, sometimes the user information of other systems may be obtained through the interface.
, for example, on the internet star, you can register an account or log on to a broadband or PHS account, so these complicated judgments are placed on the business logic layer.
This layer is the most changing layer. We try to reflect all user changes here. Once the user's business logic changes, you only need to change the code at this layer.

Pay attention to the difference between a concept, a system model and business logic. The system model is a planning and database design for the system running mode after user requirement analysis.
It is built based on the system model.
For example, we want to design an online bookstore. After analysis, we decided to create a table to store the book information, including ISBN and the name of the book. Wait for us to do the result
In half, the customer suddenly said that it seems that the attributes of different books to be stored are not the same. Children's books need to indicate the ages suitable for reading, and science books need to indicate related technologies.
Type. Are you crazy at this time? In this case, the system model needs to be modified. Where is the error? It may be that you are not careful enough when investigating your needs.
Why. When making changes to the system model, adding or removing database fields is similar. At this time, no architecture can be guaranteed not to modify each layer.
Code. This is inevitable.

What about the business logic? What is business logic is actually logical judgment. The poorly designed logic layer may be full of IF... else... well designed, maybe everywhere.
Classic application of the mode. However, no matter what the design is, what the business logic layer does most is judgment and data organization. For example, log on. You can also use the interconnected stars as an example.

In the customer's requirement Description: For the entered user name, first check whether the user is a broadband user, and then check whether the user is a registered user. If neither of them is a foreign user, return failure.

This is the business logic.
If the customer modified the business logic of the login method at a later time, the customer first checked whether the user was saved, then checked whether the user was registered, and finally checked whether the user was a Broadband User.

You only need to modify the user. login code.

So my point is that we should do a good job of requirement research when designing the system, design the system model, keep the margin of changes, and persuade users not to change the system in business as much as possible.
The requirement of the model is changed. This is the design of the system. In terms of system design hierarchy, MVC is used to separate responsibilities and prepare for system changes brought about by business logic changes. In business
This is a system change.

Finally, let's talk about the new ideas of golden ocean.
========================================================== ============================================
Table-Form Control.

Because it is an information management program and data-centered program, data is usually stored in the database, and the database generally provides powerful data operation functions.

Why do we only use databases as containers for data storage?

Why should we ignore the power of t_ SQL?

So my idea is (Information Management Programs): Mainly databases, programming around t_ SQL.

Abstract from the real world, we get books, cats, dogs, and animals.

So what will we get from the database's point of view? I got the Form Control and paging control.

========================================================== ========================================================
In this way, Kim passed the business logic directly from data to performance. However, this problem is obvious and cannot be solved. If the customer needs a data before entering the database, it must undergo complicated judgment and calculation before receiving the data into the database. Then the problem arises. First, this control cannot adapt to all database designs. It also requires special configuration tables or files for support, or simply uses its own set to store data. The final result is that the control may be modified due to any changes made by the system. Haha

========================================================== ========================================================== =
If a class can implement a function, and the internal code of the class is not very complex, it is clear, maintainable, and scalable.

Is this class still coupled?

the class is not coupled internally, but coupling occurs only when this class is called.
================================================= ========================================================== ====< br> I understand it here, the simpler the class, the easier the maintenance

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.