UML Modeling QuickStart 03 basic Structure Modeling CLASS

Source: Internet
Author: User

2015/03/25-07:19


"Declaration" Welcome reprint, but please keep the article original source: http://blog.csdn.net/yelangjueqi/article/details/44733433


1, Getting StartedClass is the most important module in any object-oriented system. A class is a description of a set of objects that have the same properties, actions, relationships, and semantics. A class can implement one or more interfaces.

Class can be used to capture vocabularies in a system that is being developed. These classes can include abstractions that are part of the problem domain, or the classes that make up the implementation. Can be used to describe software things and hardware things, and can even describe purely conceptual things.

UML provides a graphical representation of a class. This notation enables the visualization of abstractions independently of any programming language and emphasizes the most important parts of abstraction: Names, attributes, and operations.



2, Terminology and concepts2.1, Name
Each class must have a name that differs from the other class. The name is a string. A separate name is called the simple name, and the class with the name of the package that contains the class is called the qualified name (qualified name), and the drawing class can only display its name. (Split class name and package name use double colons)


2.2, Properties
On the graph, the properties are listed in the following column of the class name. You can display only the name of the property.
properties can be further elaborated by declaring the class of the property and the possible default initial values of the property


2.3, Operation
an operation (operation) is an implementation of a service that can be requested by an object of any class to affect its behavior. In other words, an operation is an abstraction of what an object does, and it is shared by all objects of that class. A class can have any number of operations, or it can have no operations at all. On the graph, the action is listed in the column below the class's property bar. You can display only the name of the action, or you can further detail the implementation of the operation with a comment or activity diagram.
You can specify the operation's feature tag to detail the operation, which contains the name, type, and default value of all parameters, and, if it is a function, also includes the return type. You can also detail other features of the operation, such as marking the operation as polymorphic, unchanging, or describing its visibility.



2.4, in order to better organize a long list of properties and operations, you can use the diffraction pattern to add a prefix describing its kind before each set of properties and operations.


3, Common modeling technology3.1, modeling the vocabulary of the system
3.2, modeling the distribution of responsibilities in the system
To model the distribution of responsibilities in the system, the following work should be done:
A, identify a group of classes that work closely together to accomplish certain behaviors
B, identify a set of responsibilities for each of these classes
C, observing this set of classes as a whole, splitting the classes of excess responsibilities into smaller abstractions, synthesizing larger classes of classes that are too trivial to function, and redistributing responsibilities so that each abstraction is reasonably present.
D, consider the ways in which these classes work together and redistribute their responsibilities accordingly, so that no class in the collaboration has too much or too much responsibility.
3.3, modeling non-software things
3.4, Modeling simple types
To model a simple type, do the following:
A, modeling things that are abstract as types or enumerations, which can be represented by a class representation with the appropriate diffraction type
B, if you need to detail the value of the range associated with this type, you can use constraints


4, Tips and tricksWhen modeling a class with UML, remember that each class should be mapped to a tangible or conceptual abstraction for the end user or the implementing person. A well-structured class should meet the following conditions:
A, which provides a clear abstraction for things taken from a problem domain or a word in a solution domain.
B, embed a small, clearly defined set of responsibilities, and implement them well.
C, clearly separate the abstract statute from its realization.
D, simple and understandable, adaptable and scalable.
When drawing a class with UML, the following policies are followed:
A, only in the context of the class to understand the characteristics of the more important classes of abstraction.
B, grouped by attribute and type of action to better organize its long list.
D, display the related classes in the same class diagram.



UML Modeling QuickStart 03 Basic structure Modeling CLASS

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.