Understanding of the basic knowledge of UML use case diagrams and class diagrams

Source: Internet
Author: User

Preface: A basic knowledge of the UML use case diagrams and class diagrams that are recorded for learning. UML's use case diagram:
The purpose of UML's use case diagrams: To help the development team to understand the functional requirements of the system in one by one visual ways. UML Use case diagrams contain elements: (1) Contributor: Represents a user organization or external system that interacts with your application or system (PS: With a villain to express).

(2) Use case: A use case is an externally visible system function that describes the service provided by the system (PS: represented by an ellipse ).

(3) Subsystem: Used to display a part of the system function. This part of the function is closely linked.

The relationship between UML use case diagrams consists of 5 main types: (1) Association (2) generalization (3) contains (4) Extended Association: Represents the communication between a participant and a use case, and either party can send or receive messages. (PS: Arrow pointing--point to message Receiver) generalization: is the usual understanding of the continuation of the relationship, the child use case and the parent use case similar, but shows a more specific behavior, the child use case will inherit all the structure, behavior and relationships of the parent use case. A child use case can use a section of the parent use case, or it can be overloaded. The parent use case is usually abstract. (PS: Arrow pointing--pointing to the parent case) contains: The containment relationship is used to break down the functionality represented by a more complex use case into smaller steps. (PS: Arrow pointing--pointing to the decomposed function case). Extension: Extension relationships are extensions of the use case functionality, which is equivalent to providing an additional function for the underlying use case. (PS: Arrow pointing--point to the underlying use case). Second, the UML class diagram:
Class Diagrams: Class diagrams are used to describe the classes contained in the system and the interrelationships between them, helping people to simplify the understanding of the system, which is an important product of the system analysis and design phase. It is also an important model basis for system coding and testing. In the system analysis and design phase, classes can usually be divided into three types, namely, entity class, control class, and boundary class (boundary Class). (1) Entity classes: Entity classes correspond to each entity in the system requirements, which are typically stored on persistent storage media, generally using database tables and file records, and entity classes contain both classes that store and pass data, and classes that manipulate data. Entity classes are derived from the nouns in the requirements specification, such as users, merchants, etc. (2) Control class: The control class is used to embody the execution logic of the application, provide the corresponding business operation, abstract the control class can reduce the coupling degree between the interface and the database. The control class is usually a noun that is transformed by the phrase of the verb-object structure, such as adding a commodity to a commodity, and registering a user registration class. (3) Boundary class: The boundary class is used to abstract the interaction object between the external user and the system. UML diagram of a class: In UML, a class is represented by a rectangle that contains a class name, attributes, and operations with a separator line. Such as:

In UML class diagrams, classes generally consist of three parts: (1) The operation of the class name (3) class's Attribute (3) class. As in the UML class diagram, employee represents the class name, name, age, e-mail represents the properties of the class, and Modifyinfo () represents the operation of the class. (PS: "-" stands for private, "+" stands for public, "#" stands for protected) the relationship between classes and classes: In software systems, classes do not exist in isolation, there are various relationships between classes and classes, and UML provides different representations for different types of relationships. The relationships between classes and classes are: (1) Association relationship (2) dependency relationship (3) generalization relation (4) interface and implementation relationship. 1. Association Relationship: Association is the most common relationship between classes and classes, and it is a structured relationship that indicates that a class of objects is associated with another class of objects, such as classes and students. In a UML class diagram, a class that is linked by a solid line to an object associated with a relationship is typically used by a class's object as a member variable of another class when implementing an association relationship using a Java programming language. When you use a class diagram to represent an association relationship, you can label the role name on the association line, typically using a verb or noun that represents the relationship between the two, representing the role name (sometimes the noun is the instance object name), and the relationship ends up representing two different roles, so you can include two role names in an association relationship, which is not required. Can be increased as needed, with the aim of making the relationships between classes more explicit. 2. Dependency: A dependency is a usage relationship, and a change in a particular thing can affect other things that use the thing, and use dependencies when it is necessary to indicate that one thing is using another. In most cases, a dependency is embodied in a method of a class that uses an object from another class as a parameter. In UML, a dependency relationship is indicated by a dashed line with arrows, and the relying party points to the relying party. In the system implementation phase, the dependencies are usually implemented in three ways, the first and most common way is to use the object of one class as the parameter of the method in another class, and the second is to use the object of another class as its local variable in the method of one class. The third way is to invoke the static method of another class in the method of one class. 3, generalization relationship: The generalization relationship is also an inheritance relationship, which is used to describe the relationship between the parent class and the subclass. In UML, the generalization relation is represented by a straight line with a hollow triangle. 4, interface and implementation relationship: Interfaces can also have a similar relationship with the class of inheritance and dependency, but there is also an implementation relationship between the interface and the class, in which the class implements the interface, the operation of the class implements the operation declared in the interface. In UML, the implementation relationship between a class and an interface is represented by a dashed line with a hollow triangle.     in UML, association relationships usually include the following forms: (by default, associations are bidirectional)
(1) Bidirectional Association (2) One-way Association (3) Self-association (4) Multiplicity Association (5) aggregation relationship (6) combinatorial relationship.(1) Bidirectional association: By default, the association is bidirectional. (2) One-way Association: The Association of a class can also be unidirectional, and one-way association is represented by a solid line with arrows.
(3) Self-correlating: There may be some classes in the system where the Property object type is the class itself, and this particular association is called a self-association. (4) Multiple relationships: Multiple association relationships, also known as multiplicity associations, represent the number of two associated objects in relation to each other. In UML, the multiplicity of objects can be represented directly on the associated line by a number or a range of numbers. There can be multiple multiple association relationships between objects, and common multiplicity representations are as follows:


(5) Aggregation relationship: The aggregation relationship represents the relationship between the whole and the part. In an aggregation relationship, the member object is part of the overall object, but the member object can exist independently from the overall object. In UML, the aggregation relationship is represented by a straight line with a hollow diamond. (6) Combinatorial relationship: The combined relationship also represents the relationship between the whole and part of the class, but in the composite relationship the whole object can control the life cycle of the member object, and once the whole object does not exist, the member object will not exist, and the member object has a die relationship with the whole object. In UML, a composite relationship is represented by a straight line with a solid diamond.



Reference Link: http://www.uml.org.cn/oobject/201211231.asp
http://kb.cnblogs.com/page/129491/











Understanding of the basic knowledge of UML use case diagrams and class diagrams

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.