【UML】-NO.40.UML.1.UML.1.001-【UML】- uml

1.0.0 Summaryhtml

Tittle:【UML】-NO.40.UML.1.UML.1.001-【UML】- umlexpress

Style:DesignPattern安全

Series:DesignPatternapp

Since:2017-11-02ide

End:....工具

Total Hours:...ui

Degree Of Diffculty:2this

Degree Of Mastery:2lua

Practical Level:2idea

Desired Goal:2

Archieve Goal:....

Gerneral Evaluation:...

Writer:kingdelee

Related Links:

http://www.cnblogs.com/kingdelee/

 

https://www.uml-diagrams.org/uml-25-diagrams.html 

0.UML 2.5 Diagram

 

1.Package Diagram

Package diagrams are used to reflect the organization of packages and their elements. When used to represent class elements, package diagrams provide a visualization of the namespaces. The most common use for package diagrams is to organize use case diagrams and class diagrams, although the use of package diagrams is not limited to these UML elements.

包圖用於反映包及其元素的組織。當用於表示類元素時,包圖提供了名稱空間的可視化。包圖最多見的用途是組織用例圖和類圖,儘管包圖的使用並不侷限於這些UML元素。

2.Component Diagram

Component diagrams illustrate the pieces of software, embedded controllers, etc., that will make up a system. A component diagram has a higher level of abstraction than a Class Diagram - usually a component is implemented by one or more classes (or objects) at runtime. They are building blocks so a component can eventually encompass a large portion of a system.

組件圖說明了軟件、嵌入式控制器等組成了一個系統。組件圖比類圖具備更高的抽象級別——一般組件是由一個或多個類(或對象)在運行時實現的。它們是構建塊,所以組件最終能夠包含系統的很大一部分。

 

3.Class Diagram

類圖顯示了任何面向對象系統的構建塊。類圖描述模型的靜態視圖,或模型的一部分,描述它所擁有的屬性和行爲,而不是詳細描述實現操做的方法。類圖在說明類和接口之間的關係方面最有用。泛化、聚合和關聯在反映繼承、組合或使用和鏈接方面都是有價值的。

 

Class Notation

Interface

An interface is a specification of behavior that implementers agree to meet; it is a contract. By realizing an interface, classes are guaranteed to support a required behavior, which allows the system to treat non-related elements in the same way – that is, through the common interface.

Interfaces may be drawn in a similar style to a class, with operations specified, as shown below. They may also be drawn as a circle with no explicit operations detailed. When drawn as a circle, realization links to the circle form of notation are drawn without target arrows.

 Tables

Although not a part of the base UML, a table is an example of what can be done with stereotypes. It is drawn with a small table icon in the upper right corner. Table attributes are stereotyped «column». Most tables will have a primary key, being one or more fields that form a unique combination used to access the table, plus a primary key operation which is stereotyped «PK». Some tables will have one or more foreign keys, being one or more fields that together map onto a primary key in a related table, plus a foreign key operation which is stereotyped «FK».

Association

 An association implies two model elements have a relationship - usually implemented as an instance variable in one class. This connector may include named roles at each end, cardinality, direction and constraints. Association is the general relationship type between elements. For more than two elements, a diamond representation toolbox element can be used as well. When code is generated for class diagrams, named association ends become instance variables in the target class. So, for the example below, "playsFor" will become an instance variable in the "Player" class.

關聯意味着兩個模型元素有關係——一般在一個類中做爲實例變量實現。這個鏈接器可能包括每一個端點的命名角色、基數、方向和約束。關聯是元素之間的通常關係類型。對於超過兩個元素,還可使用菱形表示工具箱元素。當爲類圖生成代碼時,命名關聯在目標類中變成實例變量。所以,在下面的示例中,「playsFor」將成爲「Player」類中的一個實例變量。

 

Generalizations

A generalization is used to indicate inheritance. Drawn from the specific classifier to a general classifier, the generalize implication is that the source inherits the target's characteristics. The following diagram shows a parent class generalizing a child class. Implicitly, an instantiated object of the Circle class will have attributes x_position, y_position and radius and a method display(). Note that the class "Shape" is abstract, shown by the name being italicized.

泛化用於表示繼承。從特定的分類器到通常的分類器,歸納的含義是源繼承了目標的特徵。下圖顯示了父類對子類的通常化。隱式地,Circle類的實例化對象將具備屬性x_position、y_position和radius以及一個方法display()。請注意,類「形狀」是抽象的,它顯示的名稱是斜體的。

 

The following diagram shows an equivalent view of the same information.

 

Aggregations

Aggregations are used to depict elements which are made up of smaller components. Aggregation relationships are shown by a white diamond-shaped arrowhead pointing towards the target or parent class.

聚合用來描述由較小的組件組成的元素。彙集關係由指向目標或父類的白色菱形箭頭表示。

A stronger form of aggregation - a composite aggregation - is shown by a black diamond-shaped arrowhead and is used where components can be included in a maximum of one composition at a time.
一種更強的聚合形式——複合聚合——由一種黑色菱形箭頭所示,而且在每次最多隻能包含一種成分的狀況下使用。

If the parent of a composite aggregation is deleted, usually all of its parts are deleted with it;
若是複合聚合的父節點被刪除,則它的全部部分一般都被刪除;

however a part can be individually removed from a composition without having to delete the entire composition.
然而,一個部分能夠單獨從一個組合中刪除,而不須要刪除整個組合。

Compositions are transitive, asymmetric relationships and can be recursive.
組成是傳遞的,不對稱的關係,能夠是遞歸的。

The following diagram illustrates the difference between weak and strong aggregations.
下圖說明了弱聚合和強聚合之間的區別。

An address book is made up of a multiplicity of contacts and contact groups.
地址簿是由多個聯繫人和聯繫組組成的。

A contact group is a virtual grouping of contacts;
聯繫小組是一組虛擬的接觸者;

a contact may be included in more than one contact group.
一個接觸能夠包括在多個接觸小組。

If you delete an address book, all the contacts and contact groups will be deleted too;
若是你刪除了通信錄,全部的聯繫人和聯絡小組也將被刪除;

if you delete a contact group, no contacts will be deleted.
若是您刪除了一個聯繫人組,則不會刪除任何聯繫人。

Association Classes

 

An association class is a construct that allows an association connection to have operations and attributes.
關聯類是一個構造,容許關聯鏈接具備操做和屬性。

The following example shows that there is more to allocating an employee to a project than making a simple association link between the two classes: the role the employee takes up on the project is a complex entity in its own right and contains detail that does not belong in the employee or project class.
下面的例子顯示,有更多的員工分配一個項目比製做一個簡單的協會之間的聯繫兩個類:角色的員工佔用項目自己是一個複雜的實體和包含細節不屬於員工或項目類。

For example, an employee may be working on several projects at the same time and have different job titles and security levels on each.
例如,一個員工可能同時在多個項目上工做,而且在每一個項目上都有不一樣的工做頭銜和安全級別。

Dependencies
A dependency is used to model a wide range of dependent relationships between model elements. It would normally be used early in the design process where it is known that there is some kind of link between two elements, but it is too early to know exactly what the relationship is. Later in the design process, dependencies will be stereotyped (stereotypes available include «instantiate», «trace», «import», and others), or replaced with a more specific type of connector.

Traces
The trace relationship is a specialization of a dependency, linking model elements or sets of elements that represent the same idea across models. Traces are often used to track requirements and model changes. As changes can occur in both directions, the order of this dependency is usually ignored. The relationship's properties can specify the trace mapping, but the trace is usually bi-directional, informal and rarely computable.

Realizations
The source object implements or realizes the destination. Realizations are used to express traceability and completeness in the model - a business process or requirement is realized by one or more use cases, which are in turn realized by some classes, which in turn are realized by a component, etc. Mapping requirements, classes, etc. across the design of your system, up through the levels of modeling abstraction, ensures the big picture of your system remembers and reflects all the little pictures and details that constrain and define it. A realization is shown as a dashed line with a solid arrowhead.

Nestings
A nesting is connector that shows the source element is nested within the target element. The following diagram shows the definition of an inner class, although in EA it is more usual to show them by their position in the project view hierarchy.

 

相關文章
相關標籤/搜索