UML Class Diagram

Source: Internet
Author: User

In object-oriented processing. The core of the class diagram, which provides the primary rules for defining and using objects.

It is the descriptive description of the class, the interface and the relationship between them, which shows each class in the static structure of the system, the model.

First, class diagram

1. Class

A class is the basis for a class diagram that defines a set of objects with state and behavior that have the same properties, operations, relationships, and semantics.

The UML specification uses an icon representing a class with 3 pre-defined columns, containing: name, attributes, and operations.


The icons in Stuid, Geton, and Getoff represent the public type and can also be expressed as "+". The properties and operations that make this declaration can be viewed, used, and updated outside of the class where it is located. The icon before the Stuname represents the protected type, and "#" indicates that properties and operations can be visited by other methods of thunder. can also be visited by the method corresponding to the inheriting class, whereas the Stusex is a private type and can be represented by "-", which is the most restrictive type and can only be used by the current class.


2. Relationship

Association: Defines the criteria for relationships between objects. When an application creates and uses a relationship, the association provides rules that maintain the integrity of the relationship.

(1) Aggregation: Represents the relationship between the general and the part. Some classes can be separated from the general class

(2) Combination: Indicates the relationship between the general and the part, some classes need the overall class talent existence

Generalization: Generalization and inheritance are used to describe the type of a class that is also a class. The description describes the relationship between the General affairs and the special class of the thing.

Dependency: is a usage relationship. A change in the specification of a thing might affect the use of it and a thing

Implementation: is a semantic relationship between the classes, in which a class element description describes a contract with a class element guarantee implementation


Second, class VS VB

VB in the definition of event methods, we often used to public, Private. And in the class of learning process also practical to.

In VB, public represents a global variable. Can be applied to whatever window and module. Private is used only for the current window or module. However, in a class, we often define the visibility of attributes and operations, which we also need to use, just slightly different. Properties and operations declared as public can be viewed, used, and updated outside of the class where it is located.

It is declared that the private visibility limit is the most restrictive and is used only in declared classes. The other is declared as protected, which can be interviewed by other means of the class. You can also be interviewed by the method that corresponds to the inherited class declaration.


Iii. Summary

A class diagram is a core figure in 9 diagrams, and basically other graphs have a relationship with the graph.

Though it is a new knowledge that we are exposed to. But the fundamental. It's also a graphic of what we see in our ordinary lives, and the class diagram is just a synonym for the graphics of the transaction.

Only after we have studied hard, you will find that this is just qianlvzhiji. Therefore, when exposure to new knowledge, do not be afraid, learn new knowledge, do not forget the old knowledge.


the second part will be used to paint the class diagram to solve

Copyright notice: This article blog original articles, blogs, without consent, may not be reproduced.

UML Class Diagram

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.