<<

Unified Modeling Language (UML)

Péter Jeszenszky Faculty of Informatics, University of Debrecen [email protected]

Last modified: April 11, 2021 What is UML?

● „The OMG's Unified Modeling Language (UML) helps you specify, visualize, and document models of software systems, including their structure and design [...]. (You can use UML for business modeling and modeling of other non- software systems too.)” – See: Introduction To OMG's Unified Modeling Language https://www.omg.org/UML/what-is-uml.htm

2 (OMG)

● An international, open membership, not-for-profit technology standards consortium that was founded in 1989. https://www.omg.org/ ● Standards: – MetaObject Facility (MOF) https://www.omg.org/mof/ – Model Driven Architecture (MDA) https://www.omg.org/mda/ – Systems Modeling Language (SysML) https://www.omg.org/spec/SysML/ – Unified Modeling Language (UML) https://www.uml.org/ – XML Metadata Interchange (XMI) https://www.omg.org/spec/XMI/ – …

3 History

● UML is based on other object-oriented methodologies for software systems development: – Booch () – OMT (Object-Modeling Technique) (James E. Rumbaugh et al.) – OOSE (Object-Oriented ) () ● „Three Amigos”: Booch, Jacobson, and Rumbaugh – UML were developed under their leadership. ● See also: – The Unified Modeling Language – Versions of UML Versions of UML https://www.uml-diagrams.org/

4 Current Standards

● OMG Unified Modeling Language (OMG UML) Version 2.5.1. December 2017. https://www.omg.org/spec/UML/2.5.1/ ● Definition (DD) Version 1.1. June 2015. https://www.omg.org/spec/DD/1.1/ ● XML Metadata Interchange (XMI) Version 2.5.1. June 2015. https://www.omg.org/spec/XMI/2.5.1/ ● OMG Meta Object Facility (MOF) Core Specification Version 2.5.1. November 2016. https://www.omg.org/spec/MOF/2.5.1/ ● Object Constraint Language Version 2.4. February 2014. https://www.omg.org/spec/OCL/2.4/

5 Object Constraint Language (OCL)

● A formal language used to describe expressions on UML models. ● OCL is not a , instead, it is a modeling language. – OCL expressions are not directly executable. ● OCL expressions are guaranteed to have no side effects. ● OCL is a typed language so that each OCL expression has a type. ● OCL can be used for a number of different purposes: – As a query language. – To specify invariants on classes and types in the class model. – To describe pre- and post conditions on operations. – …

6 XML Metadata Interchange (XMI)

● An XML format for metadata exchange between applications. ● Most often, it is used for the exchange of UML models, however, it can be used to serialize any type of metadata whose metamodel can be expressed in MOF.

7 Model

● A model is a description of a system, where “system” is meant in the broadest sense and may include not only software and hardware but, for example, organizations and processes. ● It describes the system from a certain viewpoint for a certain category of stakeholders (e.g., designers, users, or customers of the system) and at a certain level of abstraction. ● A model is complete in the sense that it covers the whole system, although only those aspects relevant to its purpose (i.e., within the given level of abstraction and viewpoint) are represented in the model. – See: OMG Unified Modeling Language (OMG UML) Version 2.5.1. December 2017. https://www.omg.org/spec/UML/2.5.1/

8 Metamodell

● A metamodel is a model of a model. ● In UML, a metamodel is a model used to model itself. – It can is used to model itself as well as other models and metamodels. – For example, the MOF model is a metamodel.

9 Metaclass

● A metaclass is a class in an object oriented programming language whose instances are classes. – Python: ● PEP 3115 – Metaclasses in Python 3000 https://www.python.org/dev/peps/pep-3115/ ● Python 3.9.2 documentation – Data model – Metaclasses https://docs.python.org/3/reference/datamodel.html#metaclasses – Groovy: ● The Groovy programming language – Runtime and compile-time metaprogramming http://groovy-lang.org/metaprogramming.html ● groovy.lang.MetaClass http://docs.groovy-lang.org/latest/html/api/groovy/lang/MetaClass.html – UML: classes in a metamodel are called metaclasses (examples of UML metaclesses include Element, Classifier, …).

10 Syntax (1)

● Linguistics: – “the way in which linguistic elements (such as words) are put together to form constituents (such as phrases or clauses)” – “the part of grammar dealing with this” ● See: https://www.merriam-webster.com/dictionary/syntax ● Programming languages: – “The syntax of a programming language describes the proper form of its programs […].” ● See: Alfred V. Aho, Monica S. Lam, Ravi Sethi, Jeffrey D. Ullman. : Principles, Techniques, & Tools. 2nd ed. Addison Wesley, 2006.

11 Syntax (2)

● Abstract syntax: a description of the structure of language elements that is independent of any particular representation. ● Concrete syntax: a mapping of the abstract syntax to a particular (machine) representation.

12 Syntax (3)

● Abstract syntax: ● Concrete syntax: – Infix notation: operator ● (1 + 2) * 3 – Prefix notation:

● arg1 arg2 (* (+ 1 2) 3) – Postfix notation: ● ((1 2 +) 3 *)

13 Syntax (4)

● The abstract syntax of UML is specified using a UML model called the UML metamodel.

14 Semantics (1)

● Definition (programming languages): – “The syntax of a programming language describes the proper form of its programs, while the semantics of the language defines what its programs mean; that is, what each program does when it executes.” ● See: Alfred V. Aho, Monica S. Lam, Ravi Sethi, Jeffrey D. Ullman. Compilers: Principles, Techniques, & Tools. 2nd ed. Addison Wesley, 2006.

15 Semantics (2)

● The following sentence demonstrates the difference between syntax and semantics: – „Colorless green ideas sleep furiously.” ● See: Noam Chomsky. Syntactic Structures. Mouton & Co., 1957. ● The sentence is grammatically (syntactically) correct, however, it is meaningless.

16 Domain-specific languages

● Domain-specific language (DSL): a computer language that's targeted to a particular kind of problem, rather than a general purpose language that's aimed at any kind of software problem. – Examples: BibTeX/LaTeX, CSS, DOT (), Gradle DSL, Make, PlantUML, SQL, … – See: Martin Fowler. DomainSpecificLanguage. https://martinfowler.com/bliki/DomainSpecificLangu age.html

17 Meta Object Facility (MOF) (1)

● The Meta Object Facility (MOF) provides an open and platform-independent metadata management framework and associated set of metadata services to enable the development and interoperability of model and metadata driven systems. – Examples of systems that use MOF include modeling and development tools, data warehouse systems, metadata repositories, etc. ● See: OMG Meta Object Facility (MOF) Core Specification, Version 2.5.1

18 Meta Object Facility (MOF) (2)

● MOF is a domain-specific language for defining metamodels. – The MOF model is used to model itself as well as other models (e.g., UML and CWM). – Can be used to model arbitrary metadata (for example, software configuration or requirements metadata).

19 Meta Object Facility (MOF) (3)

● UML metamodel: – A UML model that specifies the abstract syntax of UML. – This metamodel uses constructs from a constrained subset of UML that is identified in the MOF specification and used for constructing metamodels.

20 Layered Metamodel Architecture

● When dealing with defining languages there are generally three layers that always have to be taken into account: – The language specification, or the metamodel. – The user specification, or the model. – Objects of the model.

21 Layered Metamodel Architecture

:

metamodel Class Association

«instanceOf» «instanceOf» «instanceOf»

car model Person Car *

22 The Four-Layer Metamodel Hierarchy (UML 2.4.1)

● Meta-metamodel (M3): – The primary responsibility of this layer is to define the language for specifying a metamodel. – A meta-metamodel is typically more compact than a metamodel that it describes. – It is generally desirable that related metamodels and meta-metamodels share common design philosophies and constructs. ● Metamodel (M2): – A metamodel is an instance of a meta-metamodel, meaning that every element of the metamodel is an instance of an element in the meta-metamodel. – The primary responsibility of the metamodel layer is to define a language for specifying models. ● Model (M1): – A model is an instance of a metamodel. – The primary responsibility of the model layer is to define languages that describe semantic domains, i.e., to allow users to model a wide variety of different problem domains, such as software, business processes, and requirements. ● Run-time instances (M0): – Contains the run-time instances of model elements defined in a model.

23 Layered Metamodel Architecture

● What is a metamodel in one case can be a model in another case, and this is what happens with UML and MOF. – Both UML and MOF are language specifications (metamodels) from which users can define their own models. – From the perspective of MOF, however, UML is viewed as a user (i.e., the members of the OMG that have developed the language) specification that is based on MOF as a language specification (metamodel).

24 The Four-Layer Metamodel Hierarchy (UML 2.4.1)

M3 (MOF) Class

«instanceOf» «instanceOf» «instanceOf»

M2 (UML) Attribute Class Instance

«instanceOf» «instanceOf» «instanceOf» «instanceOf»

Video : Video M1 (user model) «snapshot» + title : String title = "2001: A Space Odyssey"

«instanceOf»

25 M0 (run-time instances) aVideo Classifiers

● A classifier is a model element that represents a set of instances that share common features (properties, operations). ● Classifiers are organized in hierarchies by generalization. ● Specializations: data type, association, interface, class, ... ● Notation: the same as those of classes, but the name of a classifier should be centered in boldface.

26 Abstract and Concrete Syntax

● Example: {subsets owner} + annotatedElement Element + owningElement * 0..1

Abstract syntax

{subsets ownedElement} + comment Comment + ownedComment * + body : String[0..1] *

Concrete Comment syntax 27 UML Diagram Types (1)

● The two major kinds of diagram types: – Stucture :

● Show the static structure of the objects in a system.. ● That is, they depict those elements in a specification that are irrespective of time. – The elements in a structure diagram, for example, represent the meaningful concepts of an application, and may include abstract, real-world and implementation concepts. – Behavior diagrams:

● Show the dynamic behavior of the objects in a system, including their methods, collaborations, activities, and state histories. ● The dynamic behavior of a system can be described as a series of changes to the system over time. ● This taxonomy provides a logical organization for the various major kinds of diagrams. However, it does not preclude mixing different kinds of diagram types, as one might do when one combines structural and behavioral elements.

28 UML Diagram Types (2)

● Structure diagrams: ● Behavior diagrams: – – State machine diagram – diagram – – Interaction diagram: ● Timing diagram – Composite structure ● diagram ● Interaction overview – diagram –

29 UML 2.5 Diagram

Structure Diagram Behavior diagram

Package Diagram Activity Diagram

State Machine Component Diagram Diagram

Object Diagram

Class Diagram Interaction Diagram

Composite Structure Timing diagram Diagram

Communication Profile Diagram Diagram

Interaction Overview Deployment Diagram Diagram

30 Sequence Diagram Packages (1)

● A is a construct for grouping model elements that defines a namespace for its members. ● Notation: Package name

31 Packages (2)

● The members of a package can be referred to using qualified names of the form packageName::elementName (e.g., pkg::Point, pkg::Shape).

pkg

pkg Point Shape pkg

Point Shape

32 Keywords (1)

● Keywords are reserved words that are an integral part of the UML notation. ● They normally appear as text annotations attached to a UML graphic element or as part of a text line in a UML diagram. – Each keyword may only appear at certain places. ● Keywords allow to distinguish a particular UML concept (metaclass) from others sharing the same general graphical form. – See, for example classes and interfaces («interface »).

33 Keywords (2)

● Keywords are always enclosed in guillemets (« and » characters). – When the available character set does not include these symbols, >> and << can be used instead. ● Multiple keywords may apply to the same model element. – Each keyword may be enclosed in a separate pair of guillemets and listed one after the other. – Alternatively, multiple keywords may appear between the same pair of guillemets, separated by commas.

34 Comments

● Adds no semantics but may represent information useful to the reader of the model. ● Notation: – A comment is shown as a rectangle with the upper right corner bent (this is also known as a “note symbol”). The rectangle contains the body of the comment. – A dashed line connects the note symbol to each model element to which it belongs. The dashed line may be suppressed if it is clear from the context, or not important in this diagram.

This class was added right after watching the movie 'Monty Python Shrubbery 35 and the Holy Grail'. Dependencies

● A represents a supplier/client relationship between model elements where the modification of a supplier may impact the client model elements. ● Notation: – A dependency is shown as a dashed arrow between two model elements. The arrow points from the client to the supplier. The arrow may be labeled with an optional keyword or and an optional name.

«Instantiate» CarFactory Car 36 Constraints (1)

● A constraint is an assertion that indicates a restriction that must be satisfied by any valid realization of the model containing the constraint. ● Notation: – { [name:] boolean-expression } ● The specification of a user-defined constraint is often expressed as a text string in some language, whose syntax and interpretation is as defined by that language. In some situations, a formal language (such as OCL) or a programming language (such as ) may be appropriate, in other situations natural language may be used.

37 Constraints (2)

● Most generally, a constraint string is placed in a note symbol and is attached to each of the symbols for model elements to which it applies by dashed lines.

boss employee employer Person Company 0..1 * 0..1

{self.boss->isEmpty() or self.employer = self.boss.employer} 38 Constraints (3)

● For a constraint that applies to a single model element (such as a single class or association), the constraint string may be directly placed near the symbol for the model element, preferably near the name, if any. ● For a model element whose notation is a text string (such as an attribute), the constraint string may follow the textual representation of the model element.

39 Class Diagrams (1)

● “A class diagram describes the types of objects in the system and the various kinds of static relationships that exist among them. Class diagrams also show the properties and operations of a class and the constraints that apply to the way objects are connected.” – See: Martin Fowler. UML Distilled – A Brief Guide to the Standard Object Modeling Language. Third Edition. Addison- Wesley, 2003. ● “[…] a class diagram is a diagram where the primary symbols in the contents area are class symbols.” – See: OMG UML Version 2.5.1

40 Class Diagrams (2)

● Types of class diagrams (Störrle): – Domain: on the analysis level, classes correspond to concepts of the domain, the class diagram models the domain itself. – Design: classes also include technical aspects of the implementation. – Implementation: classes are equivalent with the constructs of an implementation language (for example, C++ or Java).

41 42 Source: https://www.uml-diagrams.org/class-diagrams-overview.html Classes

● Notation:

Name

Attributes

Operations

43 Visibility

● + (public) ● - (private) ● # (protected) ● ~ (package)

44 Multiplicity

● The multiplicity is a constraint on the cardinality of a collection. – The cardinality shall not be less than the lower bound and not greater than the upper bound specified for the multiplicity (unless the multiplicity is unlimited, in which case there is no constraint on the upper bound). ● Notation: – [lower_bound ..] upper_bound ● The lower bound is a non-negative integer, the upper bound is either a non- negative integer or * that represents an unlimited upper bound. ● If the lower bound is equal to the upper bound, then an alternate notation is to use just the upper bound. – For example, 1 is semantically equivalent to 1..1 multiplicity. Similarly, 5 is semantically equivalent to 5..5 multiplicity. ● The alternative notation * can be used instead of the 0..* multiplicity.

45 Properties

● A property represents either an attribute or an association end. ● Notation: – [^] [visibility] [/] name [: type] [[ multiplicity ]] [= default] [{ modifier [, modifier]* }] ● ^ indicates that the property is inherited (UML 2.5). ● / indicates that the property is derived. ● When the multiplicity is omitted, the default is 1. ● Modifier: e.g., readOnly, ordered, unordered, unique, …

46 Parameters, Parameter Lists

● Parameter list: – parameter [, parameter]* ● Parameter: – [direction] name : type [[ multiplicity ]] [= default] [{ property [, property]* }] ● Direction: in (default), out, inout, return ● Property: nonunique, ordered, seq/sequence, unique, unordered

47 Operations

● Notation: – [visibility] name ([parameter-list]) [: type] [[ multiplicity ]] [{ property [, property]* }] ● Property: nonunique, ordered, query, redefines name, seq/sequence, unique, unordered, constraint – query: means that the operation does not change the state of the system.

48 Example of a Class

Person -title: String[0..1] -name: String -birthDate: Date -/age: int {age >= 0} +Person(title: String, name: String, birthDate: Date) +Person(name: String, birthDate: Date) +getTitle(): String {query} +setTitle(title: String) +getName(): String {query} +setName(name: String) +getBirthDate(): Date {query} +setBirthDate(birthDate: Date) +getAge(): int {query}

49 Static Attributes and Operations

● Static attributes and operations are underlined. – Example:

Singleton -instance: Singleton -Singleton() +getInstance(): Singleton

50 Abstract Classes (1)

● An abstract class (classifier) has no direct instances. ● Notation: – The name of an abstract class (classifier) is shown in italics, where permitted by the font in use. Alternatively or in addition, an abstract class (classifier) may be shown using the textual annotation {abstract} after or below its name. – UML 2.5.1 makes no provision for the notation of abstract operations (personal view: this is probably a mistake).

51 Abstract Class (2)

● Example:

Shape -x: int -y: int #Shape(x: int, y: int) +getX(): int +getY(): int +moveTo(newX: int, newY: int) +getArea(): double +draw()

52 Associations (1)

● An association specifies a semantic relationship that can occur between instances. – An association declares that there can be links between instances whose types conform to or implement the associated types. ● An association has at least two association ends. – An association with two association ends is called a binary association. ● A link is an instance of an association. – I.e., it is a tuple that contains, for every end, an instance of the type of the end.

53 Associations (2)

● Notation: – Any association may be drawn as a diamond with a solid line for each end connecting the diamond to the classifier that is the end’s type. An association with more than two ends can only be drawn this way. – A binary association is normally drawn as a solid line connecting two classifiers, or a solid line connecting a single classifier to itself (the two ends are distinct).

54 Associations (3)

● The association’s name can be shown as a name string near the association symbol, but not near enough to an end to be confused with the end’s name. – On a binary association drawn as a solid line, a solid triangular arrowhead can be shown next to or in place of the name of the association pointing along the line in either direction. ● The arrow indicates that the association is to be read as associating the end away from the direction of the arrow with the end to which the arrow is pointing. ● This notation is for documentation purposes only and has no general semantic interpretation.

55 Associations (4)

● Example:

Teaching

Lecturer Student

Subject

Owns ► Person Pet

56 Associations (5)

● Association end: the connection between the line depicting an association and the icon (often a box) depicting the connected classifier. – The following notations can be placed near the end of the line (all of them are optional): ● Name (also called as role) ● Multiplicity (if no multiplicity is shown on the diagram, no conclusion may be drawn about the multiplicity in the model) ● A modifier enclosed in curly brace ● A visibility symbol – An open arrowhead on the end of an association indicates the end is navigable. A small ´ on the end of an association indicates the end is not navigable.

57 Associations (6)

● The meaning of the multiplicity of an association end: – It represents the number of values on that end, when the values at the other (n - 1) ends are fixed.

58 Associations (7)

● Example:

Teaching

lecturer student Lecturer Student 0..1 0..*

subject 0..*

Subject

owner Owns ► pet Person Pet 0..1 0..* 59 Associations (8)

● Ownership of association ends by an associated classifier may be indicated graphically by a small filled circle, which for brevity, is called the dot. – The dot is to be drawn integral to the graphic path of the line, at the point where it meets the classifier. – The dot shows that the model includes a property of the type represented by the classifier touched by the dot. This property is owned by the classifier at the other end. In such a case it is normal to suppress the property from the attributes compartment of the owning classifier. – The absence of the dot indicates ownership by the association.

Book Publisher * 1 60 Associations (9)

● Navigability means that instances participating in links at runtime (instances of an association) can be accessed efficiently from instances at the other ends of the association. – The precise mechanism by which such efficient access is achieved is implementation specific. – Association ends owned by classes are always navigable, while those owned by associations may be navigable or not.

61 Associations (10)

● Both ends are navigable. A B ● Both ends are non-navigable. ● Unspecified navigability (in a diagram where arrows are only shown for one- C D way navigable associations, this probably signifies bidirectional navigability). E F ● One end navigable and the other is non-navigable. ● One end is navigable and the other is G H non-navigable (in a diagram where arrows are only shown for one-way navigable associations, and crosses I J are suppressed).

62 Association Classes (1)

● A model element that is both an association and a class. Defines features for an association itself. ● Notation: – An association class is shown as a class symbol attached to the association path by a dashed line. – The association path/diamond and the class symbol represent the same underlying model element, thus, their names must be the same.

63 Association Classes (2)

employee Employment employer Person Company * *

Employment jobTitle startDate endDate salary

Employment employee employer Person Company * *

Employment jobTitle startDate endDate 64 salary Whole/Part Relationship (1)

● Binary associations representing a whole/part relationship: – Shared aggregation, aggregation: A part object can be included in multiple aggregate objects at a time, the part objects and the aggregate object can exist independently. – Composite aggregation, composition: A strong form of aggregation that requires a part object be included in at most one composite object at a time. If a composite object is deleted, all of its part instances that are objects are deleted with it. ● Only one end of a binary association can be marked as a shared or composite aggregation.

● Notation: Whole Part

Whole Part 65 Whole/Part Relationship (2)

● An example of aggregation:

{ordered} Polygon Point 1..* 3..*

66 Whole/Part Relationship (3)

● An example of composition:

Window

1 1 1

+title +scrollbar 1 +body 2 1 Slider Header Panel

Window

1 +window

+scrollbar +title +body 2 1 1

67 Slider Header Panel Generalization (1)

● Generalizations define generalization/specialization relationships between classifiers. Each generalization relates a specific classifier to a more general classifier. ● Given a classifier, the transitive closure of its general classifiers is often called its generalizations, and the transitive closure of its specific classifiers is called its specializations. – The immediate generalizations are also called the classifier’s parents, and where the classifier is a class, its superclasses.

68 Generalization (2)

● An instance of a classifier is also an (indirect) instance of each of its generalizations. ● When a classifier is generalized, certain members of its generalizations are inherited. ● Notation:

GeneralClassifier

SpecificClassifier

69 Generalization (4)

● Example:

Shape Shape

Polygon Ellipse Polygon Ellipse

Rectangle Circle Rectangle Circle

70 Interfaces (1)

● An interface is a kind of classifier that represents a declaration of a set of public features and obligations that together constitute a coherent service. An interface specifies a contract, any instance of a classifier that realizes the interface shall fulfill that contract. ● Interfaces may not be instantiated. Instead, an interface specification is implemented or realized by a classifier, which means that the classifier presents a public facade that conforms to the interface specification. ● Notation: Implementing Classifier Interface

«interface» Implementing 71 Interface Classifier Interfaces (2)

● Example:

«interface» Shape

+getArea(): double +draw()

Circle -x: int -y: int -radius: int -/area: double +Circle(x: int, y: int, radius: int) +getArea(): double +draw()

72 UML Tools

● Functionality that can be provided my UML tools: – Forward engineering: – Reverse engineering:

73 UML Tools: Free and Open Source Software (1)

● GUI tools: – Gaphor (written in: Python; license: Apache License 2.0) https://gaphor.org/ https://github.com/gaphor/gaphor – Modelio (operating system: , macOS, Windows; license: GPLv3) https://www.modelio.org/ https://github.com/ModelioOpenSource/Modelio – Papyrus (platform: ; license: Eclipse Public License v1.0) https://www.eclipse.org/papyrus/ – UMLet (written in: Java; license: GPLv3) https://www.umlet.com/ https://github.com/umlet/umlet ● Eclipse plugin: https://marketplace.eclipse.org/content/umlet-uml-tool-fast-uml-diagrams ● extension: https://marketplace.visualstudio.com/items?itemName=TheUMLetTeam.umlet ● Web app: UMLetino https://www.umletino.com/

74 UML Tools: Free and Open Source Software (2)

● Tools that use a DSL for creating diagrams: – Mermaid (written in: JavaScript; license: MIT License) http://mermaid-js.github.io/mermaid/ https://github.com/mermaid-js/mermaid – nomnoml (written in: JavaScript; license: MIT License) https://nomnoml.com/ https://github.com/skanaar/nomnoml – PlantUML (written in: Java; license: GPLv3) https://plantuml.com/ https://github.com/plantuml/plantuml ● Doclets that generate UML class diagrams: – UMLDoclet (written in: Java; license: Apache License 2.0) https://github.com/talsma-ict/umldoclet

75 UML Tools: Non-Free Software

● GUI tools: – Altova UModel (platform: Windows) https://www.altova.com/umodel.html – IntelliJ IDEA Ultimate Edition (platform: Linux, macOS, Windows) https://www.jetbrains.com/idea/ ● See: UML class diagrams https://www.jetbrains.com/help/idea/class-diagram.html – MagicDraw (platform: Linux, macOS, Windows) https://www.nomagic.com/products/magicdraw – (platform: Windows) https://products.office.com/en/visio/flowchart-software – ObjectAid UML Explorer (platform: Eclipse) https://www.objectaid.com/ – Sparx Systems Enterprise Architect (platform: Windows) https://sparxsystems.com/ – StarUML (platform: Linux, macOS, Windows) https://staruml.io/ – (platform: Linux, macOS, Windows) https://www.visual-paradigm.com/

● Visual Paradigm Community Edition https://www.visual-paradigm.com/download/community.jsp

76 PlantUML (1)

● A free and open source tool for creating various UML diagrams. https://plantuml.com/ https://github.com/plantuml/plantuml – Written in: Java – License: GPLv3 ● Supported diagrams: class diagram, object diagram, sequence diagram, use case diagram, … ● Provides a simple language for defining diagrams. – Class diagram syntax: https://plantuml.com/class-diagram – File extension: .puml

77 PlantUML (2)

● PlantUML uses Graphviz for creating certain diagrams. – Graphviz (platform: Linux, macOS, Windows; written in: C; license: Common Public License v1.0) https://graphviz.org/ https://gitlab.com/graphviz/graphviz/ ● A number of third-party tools use PlantUML. – See: Tools using the PlantUML language https://plantuml.com/

78 PlantUML (3)

● Példa: @startuml LegoSet class LegoSet { -number: String number: String -name: String name: String -year: int year: int -pieces: int pieces: int } * class Theme { 1 -id: int -name: String Theme -startYear: int -endYear: int id: int } name: String startYear: int endYear: int LegoSet "*" --> "1" Theme 79 @enduml PlantUML (4)

● Related tools: – PlantText https://www.planttext.com/ – UML Reverse Mapper (license: Apache License 2.0) https://github.com/iluwatar/uml-reverse-mapper ● It is both a command line tool and an Apache Maven plugin that automatically generates an UML class diagram from Java code. ● It outputs either a Graphviz .dot file or a PlantUML .puml file.

80 PlantUML (5)

● IDE support: – Eclipse: https://github.com/hallvard/plantuml – IntelliJ IDEA: PlantUML integration https://plugins.jetbrains.com/plugin/7017-plantuml-integ ration – NetBeans: PlantUML-NB – Netbeans Plugin for PlantUML http://plugins.netbeans.org/plugin/49069/plantuml https://sourceforge.net/projects/plantumlnb/ – Visual Studio Code: PlantUML https://marketplace.visualstudio.com/items?itemName= jebbs.plantuml

81 Recommended Reading

● Martin Fowler. UML Distilled – A Brief Guide to the Standard Object Modeling Language. Third Edition. Addison-Wesley, 2003. https://martinfowler.com/books/uml.html ● Robert A. Maksimchuk, Eric J. Naiburg. UML for Mere Mortals. Addison-Wesley, 2004. ● Russ Miles, Kim Hamilton. Learning UML 2.0. O’Reilly Media, 2006. ● Martina Seidl, Marion Scholz, Christian Huemer, Gerti Kappel. UML @ Classroom – An Introduction to Object- Oriented Modeling. Springer, 2015. http://www.uml.ac.at/en/

82