|
|
(не показано 5 промежуточных версий 4 участников) |
Строка 1: |
Строка 1: |
− | Можно автоматически рисовать UML-диаграммы классов по их текстовому описанию, | + | Можно автоматически рисовать UML-диаграммы классов по их текстовому описанию, причём с помощью двух расширений: |
− | близкому к описанию классов на языках типа Java/С#. | + | * [http://plantuml.sourceforge.net/ PlantUML] — более удобный, чем UMLGraph, по собственному языку разметки. |
| + | * [http://www.umlgraph.org/ UMLGraph] — по близкому к описанию классов на языках типа Java/С#. |
| | | |
− | ==Диаграммы классов== | + | = [http://plantuml.sourceforge.net/ PlantUML] = |
| + | |
| + | Полная справка по языку — [[Media:PlantUML Language Reference Guide.pdf]]. [[Файл:PlantUML Language Reference Guide.pdf|thumb|Справка по PlantUML]] |
| + | |
| + | Синтаксис вставки — просто |
| + | <pre> |
| + | <uml> |
| + | ...код... |
| + | </uml> |
| + | </pre> |
| + | |
| + | Пример графа: |
| + | {{Annotated| |
| + | <uml> |
| + | title Основной цикл — получение агрегированных проводок |
| + | |
| + | autonumber "<b>[0]" |
| + | |
| + | note left of МСФО: 1.1 |
| + | activate МСФО |
| + | МСФО -> Система: Запрос справочников |
| + | deactivate МСФО |
| + | |
| + | note right of Система: 2.1 |
| + | activate Система |
| + | Система -> МСФО: Возврат справочников |
| + | deactivate Система |
| + | note left of МСФО: 1.2 |
| + | |
| + | activate МСФО |
| + | МСФО -> Система: Запрос используемых аналитик |
| + | deactivate МСФО |
| + | note right of Система: 2.2 |
| + | activate Система |
| + | Система -> МСФО: Возврат используемых аналитик |
| + | deactivate Система |
| + | note left of МСФО: 1.3 |
| + | |
| + | activate МСФО |
| + | МСФО -> Система: Запрос выгрузки/выгрузок |
| + | deactivate МСФО |
| + | note right of Система: 2.3 |
| + | activate Система |
| + | Система -> МСФО: Возврат выгрузки/выгрузок |
| + | deactivate Система |
| + | note left of МСФО: 1.4 |
| + | |
| + | activate МСФО |
| + | МСФО -> Система: Результат выгрузки/выгрузок |
| + | deactivate МСФО |
| + | activate Система |
| + | note right of Система: 2.4 |
| + | </uml> |
| + | |<code-xml> |
| + | <uml> |
| + | title Основной цикл — получение агрегированных проводок |
| + | |
| + | autonumber "<b>[0]" |
| + | |
| + | note left of МСФО: 1.1 |
| + | activate МСФО |
| + | МСФО -> Система: Запрос справочников |
| + | deactivate МСФО |
| + | |
| + | note right of Система: 2.1 |
| + | activate Система |
| + | Система -> МСФО: Возврат справочников |
| + | deactivate Система |
| + | note left of МСФО: 1.2 |
| + | |
| + | activate МСФО |
| + | МСФО -> Система: Запрос используемых аналитик |
| + | deactivate МСФО |
| + | note right of Система: 2.2 |
| + | activate Система |
| + | Система -> МСФО: Возврат используемых аналитик |
| + | deactivate Система |
| + | note left of МСФО: 1.3 |
| + | |
| + | activate МСФО |
| + | МСФО -> Система: Запрос выгрузки/выгрузок |
| + | deactivate МСФО |
| + | note right of Система: 2.3 |
| + | activate Система |
| + | Система -> МСФО: Возврат выгрузки/выгрузок |
| + | deactivate Система |
| + | note left of МСФО: 1.4 |
| + | |
| + | activate МСФО |
| + | МСФО -> Система: Результат выгрузки/выгрузок |
| + | deactivate МСФО |
| + | activate Система |
| + | note right of Система: 2.4 |
| + | </uml> |
| + | </code-xml> |
| + | |Разметка}} |
| + | |
| + | = [http://www.umlgraph.org/ UMLGraph] = |
| + | |
| + | == Диаграммы классов == |
| <code-java> | | <code-java> |
| /** | | /** |
Строка 10: |
Строка 110: |
| String Name; | | String Name; |
| } | | } |
− |
| + | |
| class Employee extends Person {} | | class Employee extends Person {} |
| | | |
Строка 18: |
Строка 118: |
| <umlgraph> | | <umlgraph> |
| /** | | /** |
− | * @opt nodefontcolor "blue" | + | * @opt nodefontcolor «blue» |
| */ | | */ |
− | class Person { | + | class Person { |
| String Name; | | String Name; |
| } | | } |
| | | |
− | class Employee extends Person {} | + | class Employee extends Person {} |
| | | |
| class Client extends Person {} | | class Client extends Person {} |
| </umlgraph> | | </umlgraph> |
− |
| |
− |
| |
− |
| |
| | | |
| <umlgraph> | | <umlgraph> |
Строка 38: |
Строка 135: |
| | | |
| /** | | /** |
− | * @composed 1 - 4 Tyre | + | * @composed 1 — 4 Tyre |
− | * @composed 1 - 1 Engine | + | * @composed 1 — 1 Engine |
− | * @composed 1 - 1 Body | + | * @composed 1 — 1 Body |
| */ | | */ |
| class Car {} | | class Car {} |
Строка 47: |
Строка 144: |
| | | |
| <code-java> | | <code-java> |
− |
| |
| | | |
| class Tyre {} | | class Tyre {} |
Строка 61: |
Строка 157: |
| | | |
| </code-java> | | </code-java> |
− |
| |
− |
| |
− |
| |
− |
| |
− |
| |
| | | |
| <code-java> | | <code-java> |
Строка 125: |
Строка 216: |
| </umlgraph> | | </umlgraph> |
| | | |
− | | + | === Большой пример === |
− | ===Большой пример=== | + | |
| | | |
| <umlgraph> | | <umlgraph> |
Строка 197: |
Строка 287: |
| </umlgraph> | | </umlgraph> |
| | | |
− | ===Generalisation Relationships=== | + | === Generalisation Relationships === |
| | | |
| <umlgraph> | | <umlgraph> |
− |
| |
− |
| |
| /* | | /* |
| * Generalisation | | * Generalisation |
Строка 229: |
Строка 317: |
| class CheckingAccount extends BankAccount {} | | class CheckingAccount extends BankAccount {} |
| class SavingsAccount extends BankAccount {} | | class SavingsAccount extends BankAccount {} |
− |
| |
| </umlgraph> | | </umlgraph> |
− | ===Advanced Relationships=== | + | |
| + | === Advanced Relationships === |
| | | |
| <umlgraph> | | <umlgraph> |
− |
| |
− |
| |
| /* | | /* |
| * Advanced relationships | | * Advanced relationships |
Строка 257: |
Строка 343: |
| * @navassoc - - - PowerManager | | * @navassoc - - - PowerManager |
| */ | | */ |
− | class SetTopController implements URLStreamHandler { | + | class SetTopController implements URLStreamHandler { |
| int authorizationLevel; | | int authorizationLevel; |
| void startUp() {} | | void startUp() {} |
Строка 264: |
Строка 350: |
| } | | } |
| | | |
− | /** @depend - <friend> - SetTopController */ | + | /** @depend — <friend> — SetTopController */ |
| class ChannelIterator {} | | class ChannelIterator {} |
| | | |
Строка 273: |
Строка 359: |
| void toExternalForm(); | | void toExternalForm(); |
| } | | } |
| + | </umlgraph> |
| | | |
| + | === Relationships Inference === |
| | | |
− | </umlgraph>
| |
− |
| |
− | ===Relationships Inference===
| |
| <umlgraph> | | <umlgraph> |
− |
| |
− |
| |
| import java.util.List; | | import java.util.List; |
| import java.util.Map; | | import java.util.Map; |
Строка 314: |
Строка 397: |
| Person owner; | | Person owner; |
| } | | } |
− |
| |
| | | |
| </umlgraph> | | </umlgraph> |
| | | |
− | ===Schema=== | + | === Schema === |
| + | |
| <umlgraph> | | <umlgraph> |
− |
| |
| | | |
| /* | | /* |
Строка 391: |
Строка 473: |
| Name name; | | Name name; |
| } | | } |
− |
| |
| | | |
| </umlgraph> | | </umlgraph> |
| | | |
− | ===Element Visibility=== | + | === Element Visibility === |
| + | |
| <umlgraph> | | <umlgraph> |
− |
| |
| | | |
| /** | | /** |
Строка 424: |
Строка 505: |
| private void compact() {} | | private void compact() {} |
| } | | } |
− |
| |
| | | |
| </umlgraph> | | </umlgraph> |
| | | |
− | ===Association Types=== | + | === Association Types === |
| + | |
| <umlgraph> | | <umlgraph> |
− |
| |
| | | |
| /** | | /** |
Строка 439: |
Строка 519: |
| * @hidden | | * @hidden |
| */ | | */ |
− | class UMLOptions {} | + | class UMLOptions {} |
| | | |
− | /** @assoc * - "*\n\n+user " User */ | + | /** @assoc * — "*\n\n+user " User */ |
| class UserGroup {} | | class UserGroup {} |
| | | |
− | /** @navassoc "1\n\n+owner\r" - "*\n\n+key" Password */ | + | /** @navassoc «1\n\n+owner\r» — «*\n\n+key» Password */ |
| class User{} | | class User{} |
| | | |
| class Password{} | | class Password{} |
− |
| |
| | | |
| </umlgraph> | | </umlgraph> |
| | | |
− | ===Real Example (Catalina Classes)=== | + | === Real Example (Catalina Classes) === |
| + | |
| <umlgraph> | | <umlgraph> |
− |
| |
| | | |
| /* | | /* |
Строка 480: |
Строка 559: |
| abstract interface ServletResponse {} | | abstract interface ServletResponse {} |
| abstract interface Response {} | | abstract interface Response {} |
− |
| |
| | | |
| </umlgraph> | | </umlgraph> |
| | | |
− | ===Class Stereotypes and Tagged Values=== | + | === Class Stereotypes and Tagged Values === |
| + | |
| <umlgraph> | | <umlgraph> |
− |
| |
| | | |
| /* | | /* |
Строка 515: |
Строка 593: |
| /** @stereotype query */ | | /** @stereotype query */ |
| int length() {}; | | int length() {}; |
− | /** @stereotype "helper functions" */ | + | /** @stereotype «helper functions» */ |
| void reorder() {}; | | void reorder() {}; |
| } | | } |
− |
| |
| | | |
| </umlgraph> | | </umlgraph> |
| | | |
− | ===Fonts, Colors, Global and Local Options=== | + | === Fonts, Colors, Global and Local Options === |
| + | |
| <umlgraph> | | <umlgraph> |
− |
| |
| | | |
| /** | | /** |
Строка 562: |
Строка 639: |
| /** @hidden */ | | /** @hidden */ |
| class ColorValue{} | | class ColorValue{} |
− |
| |
| | | |
| </umlgraph> | | </umlgraph> |
| | | |
− | ==Еще пример== | + | == Еще пример == |
| | | |
| <umlgraph> | | <umlgraph> |
| /** | | /** |
− | * @assoc * - 1 Aeroport | + | * @assoc * — 1 Aeroport |
− | * @assoc * - 1 Aeroport | + | * @assoc * — 1 Aeroport |
− | * @assoc * - 1 PlaneModel | + | * @assoc * — 1 PlaneModel |
− | * @assoc * - 1 Company | + | * @assoc * — 1 Company |
− | */ | + | * / |
| class Race { | | class Race { |
| public DateTime dtime_depart_local; | | public DateTime dtime_depart_local; |
Строка 584: |
Строка 660: |
| | | |
| /** | | /** |
− | * @has 1 - 1..* Town | + | * @has 1 — 1..* Town |
− | */ | + | * / |
| class Country { | | class Country { |
| public Name name_rus; | | public Name name_rus; |
| public Name name_eng; | | public Name name_eng; |
| } | | } |
− |
| |
| | | |
| /** | | /** |
− | * @composed 1 - 1..* PlacesBlock | + | * @composed 1 — 1..* PlacesBlock |
− | */ | + | * / |
| class PlaneModel { | | class PlaneModel { |
| public Name name; | | public Name name; |
Строка 600: |
Строка 675: |
| | | |
| /** | | /** |
− | * @assoc * - 1 PlaceType | + | * @assoc * — 1 PlaceType |
− | */ | + | * / |
| class PlacesBlock { | | class PlacesBlock { |
| public int count; | | public int count; |
Строка 613: |
Строка 688: |
| public Name name_eng; | | public Name name_eng; |
| } | | } |
− |
| |
| | | |
| /** | | /** |
− | * @assoc * - 1 Company | + | * @assoc * — 1 Company |
− | * @assoc * - 1 Race | + | * @assoc * — 1 Race |
− | */ | + | * / |
| class Tariff { | | class Tariff { |
| public Name name_rus; | | public Name name_rus; |
Строка 627: |
Строка 701: |
| | | |
| /** | | /** |
− | * @assoc * - 1 PlaceType | + | * @assoc * — 1 PlaceType |
− | * @assoc * - 1 Race | + | * @assoc * — 1 Race |
| * @note Rest | | * @note Rest |
− | * of tickets | + | * of tickets |
− | */ | + | * / |
| class Rest { | | class Rest { |
| public int count; | | public int count; |
| } | | } |
| | | |
− |
| |
| /** | | /** |
− | * @assoc * - 1 Town | + | * @assoc * — 1 Town |
− | */ | + | * / |
| class Aeroport{ | | class Aeroport{ |
| public Name code; | | public Name code; |
Строка 674: |
Строка 747: |
| </umlgraph> | | </umlgraph> |
| | | |
− | ==Ссылки== | + | == Ссылки == |
| * http://umlgraph.org Automated Drawing of UML Diagrams | | * http://umlgraph.org Automated Drawing of UML Diagrams |
| | | |
− | [[Категория: CustisWiki:Справка]] | + | [[Категория:Справка]] |
− | [[Категория: CustisWikiToLib]]
| + | {{replicate-from-custiswiki-to-lib}} |
| + | {{replicate-from-custiswiki-to-4intranet}} |
Можно автоматически рисовать UML-диаграммы классов по их текстовому описанию, причём с помощью двух расширений:
.