Understanding of UML modeling and graphic organization in software development (I)

Source: Internet
Author: User

Since UML (Unified Modeling Language) is often used in development, especially in the OOAD stage of software development, it is particularly important to understand and use UML. Before starting with UML, let's review the main features of OOAD and OOP.


OOAD: The process of analyzing and designing software systems based on object-oriented methodology. It includes the OOA analysis phase and the Ood design phase. The analysis stage mainly solves the problem of "What to do ?" But the design phase mainly solves the "How to Do?" problem ?" . Specifically, in the OOA analysis stage, the main task we need to do is to establish a view of the business problem domains (create a model) list the core tasks that must be completed by the system and the best solutions for the problem domain. In the design stage, the main task is to solve specific business problems, introduce the support required for our work and design the implementation strategy of the system. The development process of OOAD is usually as follows: a) project is divided into several modules; B) UML is used for modeling; c) usdp (unified software development process) is an iterative, incremental (demand, analysis, design, implementation, testing, etc.) development.


Main features of OOP: Encapsulation, inheritance, polymorphism, abstraction, association, aggregation, and combination.

The following describes my understanding of these features:

(1) Encapsulation: "reasonably hidden, reasonably exposed ". Specifically, data is reasonably hidden and implemented, and public methods are provided for our call.

(2) Inheritance: It occurs between the Child class and the parent class. Generally, there is a "is a" relationship between the two types, for example, the banana "is a" fruit, and the banana is a subclass, apple is the parent class. Code can be reused through inheritance, and inheritance is also the basis of polymorphism.

(3) polymorphism: "variables of the same type call the same method to show different features or behaviors ". For example, a human uses the lung to complete the Breath breath (), while a fish uses the Gill to complete the breath.

(4) Abstraction: abstraction is a process of separating method declarations from specific implementations. Through abstraction, we only need to focus on its essential features (what can be done) and ignore the specific details of an object (or entity.

(5) Association: Association is essentially a reference method for interaction between objects. When object a calls method operations or services of object B through the reference of object B, A and B are associated. For example, if a person calls a phone (called Dial (), there is an association between person and phone.

(6) aggregation: aggregation is one of the associations. An object a exists as the attribute field of another object B. When an external object (such as a car) is generated, you can specify an internal object (tire wheel) associated with it ). What does it mean? Simply put, if a car's Cara tires are broken, you can replace them with a new tire, and the tires can also be unloaded for other cars. We can see that the association in the aggregation is not that strong.

(7) combination: A combination is the most strongly correlated one. When object A contains another object B, External Object A is responsible for managing the lifecycle of internal object B. Essentially: the creation of internal object B is controlled by external object A. Take the computer and the monitor for example. When an external object (Computer) does not exist, the internal object (Display) cannot exist, this should be easy to understand ~


Cohesion and Coupling

Cohesion: measure the ability of a class to complete a job independently. Combination: measure the complexity of dependencies within or between systems. The general design principle is: "High Cohesion, low coupling", that is, we need to increase cohesion and reduce coupling.

Let's start our UML journey.


Domain Model

A domain model is also called a design model. It consists of two parts: the domain object of a specific State and behavior, and the relationship between domain objects, including: association (as described above), dependency (a object depends on the methods in Class B and constructs Class B instances), and aggregation (the relationship between the whole and the Part: for example, a hand is a part of a person ).

UML Definition: Unified Modeling Language (Unified Modeling Language) is a graphical language that can help us identify elements (use cases, classes, objects, etc.) in the OOAD stage), build a module (function division), analyze the process, and explain the important details in the system through the document (summary, detailed description.

Classification of UML graphics: Includes static models and dynamic models ). Static Modeling aims to create and record the static characteristics of a system (such as the attributes and methods contained in the class, the participants in the use case, the relationship between the use case, and the relationship between the objects ). Static Modeling includes: use case diagram, class diagram, object diagram, component diagram, and deployment diagram. Dynamic Modeling includes time sequence diagram (also called sequence diagram), collaboration diagram, state diagram, and activity diagram.


 Use case diagram in Static Modeling: It is used to display the core functions of the system and its interaction with users or systems.

================================ ======
1. Use Case: The function provided by the system for the participants. Generally, it is called a word with attention.
2. Relationship between use cases --> dotted line:
A) Inclusion relationship: major features include the "include" sub-functions.
B) extended relationships: encapsulate [relatively independent and optional] actions in the basic use case with extended extends. -- Dotted line Reverse
C) General Relationship: general and special (abstract class/interface + Implementation class/subclass) relationships. Returns the reverse arrow of a Real-line triangle.

The following figure is used to describe:


Summary

Today, I just started to talk about the features of OOAD and OOP and the classification in UML modeling (Static and Dynamic Modeling ), the last use case diagram in static modeling started our UML modeling journey. Next, we will continue to explain the remaining several common UML modeling methods in UML.


Understanding of UML modeling and graphic organization in software development (I)

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.