最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

【菜鳥博士編程繪圖學(xué)習(xí)】14種UML介紹

2022-03-16 00:37 作者:菜鳥博士_雜貨鋪  | 我要投稿

【菜鳥博士編程繪圖學(xué)習(xí)】14種UML介紹

Introduction to 14 kinds of UML


菜鳥博士Caesar?Rookie Doc, Caesar


分享快樂?Share the joy

什么是UML?

What is UML?


UML是Unified Model Language的縮寫,中文是統(tǒng)一建模語(yǔ)言,是由一整套圖表組成的標(biāo)準(zhǔn)化建模語(yǔ)言。

UML is short for Unified Model Language, and Chinese is Unified Modeling Language, a standardized modeling Language made up of a set of diagrams.

為什么要用UML?

Why use UML?

通過使用UML使得在軟件開發(fā)之前, 對(duì)整個(gè)軟件設(shè)計(jì)有更好的可讀性,可理解性,從而降低開發(fā)風(fēng)險(xiǎn)。同時(shí),也能方便各個(gè)開發(fā)人員之間的交流。

The use of UML makes the whole software design more readable and understandable before the software development, thus reducing the development risk. At the same time, also can facilitate the communication between each developer.

UML提供了極富表達(dá)能力的建模語(yǔ)言,可以讓軟件開發(fā)過程中的不同人員分別得到自己感興趣的信息。

UML provides a very expressive modeling language, which enables different people in the software development process to get the information they are interested in.


Page-Jones

在《Fundamental Object-Oriented Design in UML》 一書中總結(jié)了UML的主要目的,如下:

The main purposes of UML are summarized in the book Fundamental Object-Oriented Design in UML, as follows:

  1. 為用戶提供現(xiàn)成的、有表現(xiàn)力的可視化建模語(yǔ)言,以便他們開發(fā)和交換有意義的模型。?Provide a ready-made, expressive visual modeling language for users to develop and exchange meaningful models

  2. 為核心概念提供可擴(kuò)展性 (Extensibility) 和特殊化 (Specialization) 機(jī)制。?Provide Extensibility and Specialization mechanisms for the core concepts

  3. 獨(dú)立于特定的編程語(yǔ)言和開發(fā)過程。?Independent of a specific programming language and development process

  4. 為了解建模語(yǔ)言提供一個(gè)正式的基礎(chǔ)。?Provides a formal basis for understanding modeling languages

  5. 鼓勵(lì)面向?qū)ο蠊ぞ呤袌?chǎng)的發(fā)展。?Encourage the development of the market for object-oriented tools

  6. 支持更高層次的開發(fā)概念,如協(xié)作,框架,模式和組件。?Supports higher-level development concepts such as collaboration, frameworks, patterns, and components

  7. 整合最佳的工作方法 (Best Practices)。?Integrate Best Practices

UML圖有哪些?

What are the UML diagrams?

  • UML圖分為結(jié)構(gòu)圖和行為圖。?UML diagrams are divided into structure diagrams and behavior diagrams

  • 結(jié)構(gòu)圖分為類圖、輪廓圖、組件圖、組合結(jié)構(gòu)圖、對(duì)象圖、部署圖、包圖。?Structure diagrams are divided into class diagrams, outline diagrams, component diagrams, composite structure diagram diagrams, object diagrams, deployment diagrams, and package diagrams

  • 行為圖又分活動(dòng)圖、用例圖、狀態(tài)機(jī)圖和交互圖。?The behavior diagram is divided into activity diagram, use case diagram, state machine diagram and interaction diagram

  • 交互圖又分為序列圖、時(shí)序圖、通訊圖、交互概覽圖。?The interaction graph is divided into sequence graph, time sequence graph, communication graph and interaction overview graph

UML圖概覽

Overview of UML diagrams

什么是類圖?

What is a class diagram?

  • 【概念】 類圖是一切面向?qū)ο蠓椒ǖ暮诵慕9ぞ?。類圖描述了系統(tǒng)中對(duì)象的類型以及它們之間存在的各種靜態(tài)關(guān)系。?[ concept ] class diagram is the core modeling tool of all object-oriented methods. Class diagrams describe the types of objects in a system and the various static relationships that exist between them

  • 【目的】用來表示類、接口以及它們之間的靜態(tài)結(jié)構(gòu)和關(guān)系。?[ purpose ] is used to represent classes, interfaces, and the static structures and relationships between them

?在類圖中,常見的有以下幾種關(guān)系。 ?

In class diagrams, the following relationships are common

泛化(Generalization)

Generalization

  • 【泛化關(guān)系】是一種繼承關(guān)系,表示子類繼承父類的所有特征和行為。?A generalization is an inheritance relationship in which a subclass inherits all the characteristics and behavior of its parent class

  • 【箭頭指向】帶三角箭頭的實(shí)線,箭頭指向父類。?Arrow pointing to the solid line with the triangle arrow pointing to the parent class

實(shí)現(xiàn)(Realization)

Realization

  • 【實(shí)現(xiàn)關(guān)系】是一種類與接口的關(guān)系,表示類是接口所有特征和行為的實(shí)現(xiàn)。?An implementation relationship is a relationship between a class and an interface, indicating that a class is an implementation of all the characteristics and behaviors of an interface

  • 【箭頭指向】帶三角箭頭的虛線,箭頭指向接口。?Arrow pointing ] dotted line with a triangular arrow pointing to the interface

關(guān)聯(lián)(Association)

Association

  • 【關(guān)聯(lián)關(guān)系】是一種擁有關(guān)系,它使得一個(gè)類知道另一個(gè)類的屬性和方法。?An association is a relationship of ownership that enables a class to know the properties and methods of another class

  • 【代碼體現(xiàn)】成員變量?Member variable

  • 【箭頭指向】帶普通箭頭的實(shí)線,指向被擁有者。雙向的關(guān)聯(lián)可以有兩個(gè)箭頭,或者沒有箭頭。單向的關(guān)聯(lián)有一個(gè)箭頭。?Arrow pointing a solid line with an ordinary arrow pointing to the owner. A two-way association can have two arrows, or it can have no arrows. The one-way association has an arrow


?自己買的車,想什么時(shí)候開就開。但是車是車,人是人,沒有整體與部分的關(guān)系。 ?

You Buy your own car, you drive it whenever you want. But a car is a car and a person is a person. There is no relationship between the whole and the parts. Oh, shit

聚合(Aggregation)

Aggregation

  • 【聚合關(guān)系】是一種整體與部分的關(guān)系。且部分可以離開整體而單獨(dú)存在。聚合關(guān)系是關(guān)聯(lián)關(guān)系的一種,是強(qiáng)的關(guān)聯(lián)關(guān)系;關(guān)聯(lián)和聚合在語(yǔ)法上無法區(qū)分,必須考察具體的邏輯關(guān)系。?An aggregate relationship is a relationship between a whole and a part. And parts can exist independently of the whole. The relation of cohesion is a kind of relation of relevance, which is strong. The relation of cohesion and relevance can not be distinguished in grammar, so the concrete logical relation must be considered

  • 【代碼體現(xiàn)】成員變量?Member variable

  • 【箭頭指向】帶空心菱形的實(shí)線,空心菱形指向整體。?The arrow points to the solid line with the hollow diamond, the hollow diamond points to the whole


?電腦有鍵盤才能輸入信息,電腦是整體,鍵盤是部分,鍵盤也可以離開電腦,單純的拿去敲。所以是聚合。 ?

Computer keyboard can input information, the computer is the whole, the keyboard is part of the keyboard can also leave the computer, simply take to knock. So it's an aggregation. Oh, shit

組合(Composition)

Composition

  • 【組合關(guān)系】是一種整體與部分的關(guān)系。但部分不能離開整體而單獨(dú)存在,組合關(guān)系是關(guān)聯(lián)關(guān)系的一種,是比聚合關(guān)系還要強(qiáng)的關(guān)系。?A compositional relationship is a relationship between a whole and a part. But a part can not exist without the whole, and a composition relation is a kind of association relation, which is stronger than an aggregation relation

  • 【代碼體現(xiàn)】成員變量?Member variable

  • 【箭頭指向】帶實(shí)心菱形的實(shí)線,實(shí)心菱形指向整體。?The arrow points to the solid line with the solid diamond, the solid diamond points to the whole


?鳥是整體,翅膀是部分。鳥死了,翅膀也就不能飛了。所以是組合。我們?cè)倏匆幌?,下面的一組經(jīng)典的聚合組合關(guān)系的例子。 ?

The bird is the whole, the wing is the part. When a bird dies, its wings can't fly. So it's a combination. Let's look again at the following examples of a classic set of aggregate-combinatorial relationships. Oh, shit


?一個(gè)公司擁有多個(gè)部門,公司和部門之間是組合關(guān)系,公司破產(chǎn)了,部門就不復(fù)存在了。部門和員工是聚合關(guān)系,部門被裁掉,員工就換下家了。 ?

A company has more than one department, the relationship between the company and the department is a combination, the company goes bankrupt, the department no longer exists. Departments and employees are aggregated, and when departments are cut, employees move on. Oh, shit

依賴(Dependency)

Dependency

  • 【依賴關(guān)系】是一種使用關(guān)系,即一個(gè)類的實(shí)現(xiàn)需要另一個(gè)類的協(xié)助。?Dependency is a usage relationship in which the implementation of one class requires the assistance of another class

  • 【箭頭指向】帶普通箭頭的虛線,普通箭頭指向被使用者。?Arrow pointing a dashed line with an ordinary arrow pointing to the person being used


?老司機(jī)只管開車,車是誰(shuí)的不重要,給什么車開什么車。 ?

Old driver just drive, the car is not important, to what car to drive what car. Oh, shit

什么是組件圖?

What is a component diagram?

  • 【概念】描繪了系統(tǒng)中組件提供的、需要的接口、端口等,以及它們之間的關(guān)系。?[ concept ] describes the interfaces, ports, etc. that are provided, required, and the relationships between components in a system

  • 【目的】用來展示各個(gè)組件之間的依賴關(guān)系。?[ purpose ] to show the dependencies between the components


?訂單系統(tǒng)組件依賴于客戶資源庫(kù)和庫(kù)存系統(tǒng)組件。中間的虛線箭頭表示依賴關(guān)系。另外兩個(gè)符號(hào),表示組件連接器,一個(gè)提供接口,一個(gè)需要接口。 ?

The order system component is dependent on the customer repository and the inventory system component. The dotted arrow in the middle indicates a dependency. Two additional symbols representing component connectors, one providing an interface and one requiring an interface. Oh, shit

什么是部署圖?

What is a deployment plan?

  • 【概念】描述了系統(tǒng)內(nèi)部的軟件如何分布在不同的節(jié)點(diǎn)上。?[ concept ] describes how the software within a system is distributed across different nodes

  • 【目的】用來表示軟件和硬件的映射關(guān)系。?[ purpose ] is used to represent the mapping between software and hardware


?圖中簡(jiǎn)單的表示,不同機(jī)器上面部署的不同軟件。 ?

A simple representation of the different software deployed on different machines. Oh, shit

什么是對(duì)象圖?

What is an object graph?

  • 【概念】對(duì)象圖是類圖的一個(gè)實(shí)例,是系統(tǒng)在某個(gè)時(shí)間點(diǎn)的詳細(xì)狀態(tài)的快照。?[ concept ] an object graph is an instance of a class graph, a snapshot of the detailed state of a system at a point in time

  • 【目的】用來表示兩個(gè)或者多個(gè)對(duì)象之間在某一時(shí)刻之間的關(guān)系。?Used to indicate the relationship between two or more objects at a given moment


?圖中就是描述的,某時(shí)間點(diǎn)

That's what's depicted in the graph, a point in time

bat

蝙蝠

這個(gè)公司有一個(gè)研發(fā)部,一個(gè)銷售部,兩個(gè)部門只有一個(gè)人

The company has a research and development department, a sales department, two departments only one person

  • iisheng?愛生

。 ?

  • !important,Helvetica Neue,Helvetica,PingFang SC,Microsoft YaHei,Source Han Sans SC,Noto Sans CJK SC,WenQuanYi Micro Hei,sans-serif;font-weight:bold;font-style:normal;text-decoration:;color:#000000;background:;letter-spacing:0pt;vertical-align:baseline">什么是包圖??! important,Helvetica Neue,Helvetica,PingFang SC,Microsoft YaHei,Source Han Sans SC,Noto Sans CJK SC,WenQuanYi Micro hei,Sans-serif; font-weight: bold; font-style: normal; text-decoration: ; color: # 000000; background: ; letter-spacing: 0 pt; vertical-align: baseline”> something something something something something something something something something something something something something?

  • 【概念】描繪了系統(tǒng)在包層面上的結(jié)構(gòu)設(shè)計(jì)。?[ concept ] describes the structural design of the system at the package level

  • 【目的】用來表示包和包之間的依賴關(guān)系。?[ purpose ] is used to express dependencies between packages and packages


《Use》關(guān)系表示使用依賴,

"Use" relation means to Use dependence,

Web Shopping

網(wǎng)上購(gòu)物

依賴

Depend on

Payment

付款

《Merge》關(guān)系表示合并,

the "Merge" relationship means a merger,

Web Shopping

網(wǎng)上購(gòu)物

  • 合并了?Merged

Shopping Cart

購(gòu)物車

就擁有了

And you have it

Shopping Cart

購(gòu)物車

  • 的功能《Access》關(guān)系表示私有引入,比如代碼中的指定包名類名?The function of "Access" relationship means private introduction, such as the code in the specified package name class name

《Import》關(guān)系表示公共引入,比如Java中的

the Import relationship represents a public introduction, such as in Java

import

進(jìn)口

之后,就可以直接使用

After that, it's ready to go

import

進(jìn)口

包中的類了。什么是組合結(jié)構(gòu)圖?

Package of classes. What is the composite structure diagram?

  • 【概念】描述了一個(gè)"組合結(jié)構(gòu)"的內(nèi)部結(jié)構(gòu),以及他們之間的關(guān)系。這個(gè)"組合結(jié)構(gòu)"可以是系統(tǒng)的一部分,或者一個(gè)整體。?[ concept ] describes the internal structure of a "composite structure" and the relationship between them. This "composite structure" can be part of a system, or a whole

  • 【目的】用來表示系統(tǒng)中邏輯上的"組合結(jié)構(gòu)"。?[ objective ] is used to represent the logical "composition structure" of a system


?圖中描述了

In the diagram, you can see

Car

汽車

是由車軸連接著的兩個(gè)前面輪子、兩個(gè)后面輪子,和引擎組合的。 ?

Is a combination of two front wheels, two rear wheels, and an engine connected by an axle. Oh, shit

什么是輪廓圖?

What is a contour map?

  • 【概念】輪廓圖提供了一種通用的擴(kuò)展機(jī)制,用于為特定域和平臺(tái)定制UML模型。?[ concept ] contour diagrams provide a common extension mechanism for customizing UML models for specific domains and platforms

  • 【目的】用于在特定領(lǐng)域中構(gòu)建UML模型。?【 objective 】 to construct a UML model in a specific domain


?圖中我們定義了一個(gè)簡(jiǎn)易的

In the graph, we define a simple

EJB

的概要圖。

A summary of the.

Bean

豆子

是從

From..

Component

組件

擴(kuò)展來的。

It's an extension.

Entity Bean

實(shí)體 Bean

And

Session Bean

會(huì)話 Bean

繼承了

Inherited it

Bean

豆子

.

EJB

擁有

Own

Remote

遙遠(yuǎn)

And

Home

接口,和

Interface, and

JAR

包。 ?

Bag. bag

什么是用例圖?

What is a use case diagram?

  • 【概念】用例圖是指由參與者、用例,邊界以及它們之間的關(guān)系構(gòu)成的用于描述系統(tǒng)功能的視圖。?[ concept ] a use case diagram is a view that describes the functions of a system, consisting of actors, use cases, boundaries, and relationships between them

  • 【目的】用來描述整個(gè)系統(tǒng)的功能。?[ purpose ] used to describe the function of an entire system


用例圖中包含以下三種關(guān)系:

The use case diagram contains the following three relationships:

  • 包含關(guān)系使用符號(hào)《include》,想要查看訂單列表,前提是需要先登錄。?Include relationships use the symbol "include" to see the list of orders, provided that you are logged in first

  • 擴(kuò)展關(guān)系使用符號(hào)《extend》,基于查詢訂單列表的功能,可以增加一個(gè)導(dǎo)出數(shù)據(jù)的功能?The extended relationship uses the symbol extend, which adds the ability to export data based on the ability to query an order list

  • 泛化關(guān)系,子用例繼承父用例所有結(jié)構(gòu)、行為和關(guān)系。?Generalized Relationships, where the child use case inherits all the structures, behaviors, and relationships of the parent use case

什么是活動(dòng)圖?

What is an activity chart?

  • 【概念】描述了具體業(yè)務(wù)用例的實(shí)現(xiàn)流程。?[ concept ] describes the implementation flow of a specific business use case

  • 【目的】用來表示用例實(shí)現(xiàn)的工作流程。?[ purpose ] represents the workflow of a use case implementation


?圖中簡(jiǎn)單描述了,從開始到登錄到查看訂單列表,或者登錄失敗直接結(jié)束。 ?

The simple description in figure is from start to login to view the list of orders, or the end of a login failure. Oh, shit

什么是狀態(tài)機(jī)圖?

What is a state machine diagram?

  • 【概念】狀態(tài)機(jī)圖對(duì)一個(gè)單獨(dú)對(duì)象的行為建模,指明對(duì)象在它的整個(gè)生命周期里,響應(yīng)不同事件時(shí),執(zhí)行相關(guān)事件的順序。?[ concept ] a state machine diagram models the behavior of a single object, specifying the order in which the objects perform related events as they respond to different events throughout their life cycle

  • 【目的】用來表示指定對(duì)象,在整個(gè)生命周期,響應(yīng)不同事件的不同狀態(tài)。?[ purpose ] is used to indicate the state of a specified object in response to different events throughout its life cycle


?圖中描述了,門在其生命周期內(nèi)所經(jīng)歷的狀態(tài)。 ?

The diagram depicts the states that a door experiences during its life cycle. Oh, shit

什么是序列圖?

What is a sequence diagram?

  • 【概念】序列圖根據(jù)時(shí)間序列展示對(duì)象如何進(jìn)行協(xié)作。它展示了在用例的特定場(chǎng)景中,對(duì)象如何與其他對(duì)象交互。?[ concept ] sequence diagrams show how objects collaborate based on time series. It shows how an object interacts with other objects in a particular scenario of a use case

  • 【目的】通過描述對(duì)象之間發(fā)送消息的時(shí)間順序顯示多個(gè)對(duì)象之間的動(dòng)態(tài)協(xié)作。?【 objective 】 to display the dynamic cooperation among multiple objects by describing the time sequence of sending messages between them


?圖中展示的是支付寶條碼支付場(chǎng)景的序列圖。其中,

This is a sequence diagram of the Alipay bar code payment scenario. Among them,

loop

循環(huán)

是循環(huán),

It's a loop,

alt

谷丙轉(zhuǎn)氨酶

是選擇,序列圖的其他關(guān)系這里就不介紹了。 ?

is selection, and other relationships in the sequence diagram are not covered here. Oh, shit

什么是通訊圖?

What is a communication map?

  • 【概念】描述了收發(fā)消息的對(duì)象的組織關(guān)系,強(qiáng)調(diào)對(duì)象之間的合作關(guān)系而不是時(shí)間順序。?[ concept ] describes the organization of objects that send and receive messages, emphasizing cooperative relationships rather than chronological order

  • 【目的】用來顯示不同對(duì)象的關(guān)系。?[ purpose ] used to show the relationships between different objects


?圖中展示了一個(gè)線上書店的通訊圖,方框和小人表示生命線,不同生命線之間可以傳遞消息,消息前面的數(shù)字可以表達(dá)序列順序。 ?

The diagram shows a communication diagram of an online bookstore. The squares and little people represent lifelines. Messages can be passed between different lifelines. The numbers in front of the messages can express the sequence. Oh, shit

什么是交互概覽圖?

What is an interactive overview?

  • 【概念】交互概覽圖與活動(dòng)圖類似,但是它的節(jié)點(diǎn)是交互圖。?An interaction overview diagram is similar to an activity diagram, but its nodes are interaction diagrams

  • 【目的】提供了控制流的概述。?[ objective ] provides an overview of the control flow


?圖中表示一個(gè)調(diào)度系統(tǒng)的交互概覽圖,跟活動(dòng)圖很像。其中

The diagram represents an interactive overview of a scheduling system, much like the activity diagram. Among them

sd

動(dòng)物學(xué)家

的框代表具體的交互流程,

Box represents a specific interaction flow,

ref

裁判

框代表使用交互。 ?

the box represents the use of interaction

什么是時(shí)序圖?

What is a sequence diagram?

  • 【概念】時(shí)序圖被用來顯示隨時(shí)間變化,一個(gè)或多個(gè)元素的值或狀態(tài)的更改。也顯示時(shí)控事件之間的交互和管理它們的時(shí)間和期限約束。?[ concept ] a sequence diagram is used to show changes in the value or state of one or more elements over time. It also shows the interaction between time-controlled events and the time and deadline constraints that govern them

  • 【目的】用來表示元素狀態(tài)或者值隨時(shí)間的變化而變化的視圖。?-LSB- purpose ] a view that represents the change in the state or value of an element over time


?圖中展示了老年癡呆病人隨著時(shí)間的變化病情的變化。 ?

The picture shows the change of the patient's condition with the time. Oh, shit

參考文獻(xiàn): [1]:《Learning UML 2.0》 [2]:?uml-diagrams.org/?[3]:?visual-paradigm.com/gui?[4]:?sparxsystems.com/resour

2.0: 《學(xué)習(xí) UML 2.0》 , https://www.UML-diagrams.org/ , https://www.visual-paradigm.com/guide/ , https://sparxsystems.com/resources/tutorials/



【菜鳥博士編程繪圖學(xué)習(xí)】14種UML介紹的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
津市市| 沾化县| 平阳县| 班戈县| 沂源县| 温州市| 达日县| 荆门市| 睢宁县| 无棣县| 平江县| 开远市| 太和县| 崇阳县| 景谷| 临海市| 开阳县| 观塘区| 芜湖市| 揭阳市| 安新县| 滕州市| 双辽市| 光泽县| 拜城县| 永城市| 汾西县| 台江县| 姜堰市| 延安市| 弋阳县| 福海县| 肥西县| 永康市| 泉州市| 云南省| 晋城| 新乡县| 砚山县| 喀什市| 庆阳市|