In the previous article, the UML graphic thinking of Architecture Design briefly introduced the graphic thinking design and expressed the importance of design for architects, this section briefly introduces how to use the Unified Modeling Language (UML) to describe classes and the inheritance relationships between classes. This description is still used to write code, next, we will learn to use UML to express the connotation of the business, analyze the connotation of the business, abstract it, hide the details, and express it with UML images.
1. system analysis what is system analysis?
In most cases, when we see the word system analysis, we often get lost in its literal meaning, thinking that the analysis object is "system", which is a common loss! In fact, the analysis object is the system's "domain knowledge. As James Martin, a computer expert, said:
"OOA is not to analyze the actual system, but to analyze people's professional cognition and practices of the system-to analyze the business connotation from the collected domain concepts .」
(Object-oriented analysis is not an approach that models reality. Instead, it models the way people understand and process reality -- through the concepts they acquire .)
Analysis object: domain knowledge
Therefore, the main object of system analysis is not the system itself, but the analysis of how experts use their professional knowledge to describe the system, that is, the "Business (field)" in the minds of experts) knowledge is the main object of system analysis. Therefore, the focus is on domain knowledge rather than the system.
Business (domain) Knowledge = business connotation:
Analyzes the connotation, abstraction, and expression of the system, so that developers can understand the connotation of the business.
Find corresponding classes and Objects Based on professional knowledge, and express them in UML
Elements of knowledge: What is a concept:
Business (domain) Concept
The component of knowledge is concepts ).
Domain concepts is an integral element of domain knowledge ).
◎ A concept has its attributes and Its Relationship ).
◎ System Analysis (or OOA) is to analyze the concepts in the domain knowledge and express them with UML class representation.
Concept is abstract, representing a group of entities and an important medium of communication.
The concept is shared by everyone. The concept provides a common word that allows everyone to understand each other .」
(Concepts are shared by others. concepts provide the common vocabulary for communication .)
Concept understanding example:
Concepts:
For example, "please buy a cup of coffee" is a concept. People with this concept will understand the meaning of this sentence. He will think of real coffee based on his experience.
◎ Concept represents a group-class. People use their abilities to use their experience to think of what they represent-object ).
For example, when you hear "buy a guitar", this "Guitar" concept reminds you of an experienced guitar and goes home to the instrument line to buy a "real guitar.
Finding out the concepts in domain knowledge is to find out the objects and categories of software systems.
◎ For example, McDonald's enterprises have the following concepts: Hamburg, french fries, toys, special meals, ordering toys, customers, employees, toy dealers, and branches, which correspond to the category of software systems, as a result, McDonald's software system has categories such as hamburgers, french fries, toys, special meals, orders, toys, customers, employees, toy dealers, and branches.
2. Modeling example:
"Hou Yi invited the immortal medicine from the mother of the West, and chang'e stole the spirit medicine and became a fairy. The Lord could not help flying to the Moon Palace, and spent the boundless lonely time in the deserted Moon Palace .』
Although chang'e may be a legend rather than a reality, it is indeed a clear concept in our hearts. The legend is the main character, so it is an important category, as shown below:
The concept closely related to chang'e is: Moon
And xiandan, often expressed as follows:
Not only are the terms mentioned above, but their actions are also important. Verbs often represent the occurrence of an event. People often describe the situation of an event from people, events, times, places, and things.
◎ For example, if you eat xiandan, you will have the object of action (EAT)-xiandan, the protagonist of action-chang'e, and of course there are locations, time, and even sources of xiandan.
Iii. Relationship between model and code:
In the traditional viewpoint, most of them first draw the UML Model diagram and then start to conceive the writing of the program code, making the UML modeling a front-end work for writing the program code, therefore, many programmers regard UML modeling as a redundant burden. To save development costs, the UML modeling work will be omitted. In the trendy view, the UML Model and code are two points of view (or orientation) of the software system Ontology. They do not have a sequential relationship, but coexist and coexist with the same person's mind. This is like seeing two eyes in one's mind. Only in this way can we see a more real world and make a more perfect software system.
UML application: Analysis abstraction and Expression of business Connotation