2 Unified Modeling Language Unified Modeling Language (UML) is a standardized general-purpose modeling language in the field of software engineering. The standard is managed, and was created by, the Object Management Group.UML includes a set of graphic notation techniques to create visual models of software-intensive systems.
3 Structure DiagramsStructure diagrams emphasize the things that must be present in the system being modeled. Since structure diagrams represent the structure they are used extensively in documenting the architecture of software systems.Class diagram: describes the structure of a system by showing the system's classes, their attributes, and the relationships among the classes.Component diagram: describes how a software system is split up into components and shows the dependencies among these components.
4 Structure DiagramsComposite structure diagram: describes the internal structure of a class and the collaborations that this structure makes possible.Deployment diagram: describes the hardware used in system implementations and the execution environments and artifacts deployed on the hardware.Object diagram: shows a complete or partial view of the structure of a modeled system at a specific time.Package diagram: describes how a system is split up into logical groupings by showing the dependencies among these groupings.
5 Structure DiagramsProfile diagram: operates at the metamodel level to show stereotypes as classes with the <<stereotype>> stereotype, and profiles as packages with the <<profile>> stereotype. The extension relation (solid line with closed, filled arrowhead) indicates what metamodel element a given stereotype is extending.
6 Behavior DiagramsBehavior diagrams emphasize what must happen in the system being modeled. Since behavior diagrams illustrate the behavior of a system, they are used extensively to describe the functionality of software systems.Activity diagram: describes the business and operational step-by-step workflows of components in a system. An activity diagram shows the overall flow of control.UML state machine diagram: describes the states and state transitions of the system.Use case diagram: describes the functionality provided by a system in terms of actors, their goals represented as use cases, and any dependencies among those use cases.
7 Interaction DiagramsInteraction diagrams, a subset of behaviour diagrams, emphasize the flow of control and data among the things in the system being modeled:Communication diagram: shows the interactions between objects or parts in terms of sequenced messages. They represent a combination of information taken from Class, Sequence, and Use Case Diagrams describing both the static structure and dynamic behavior of a system.Interaction overview diagram: provides an overview in which the nodes represent interaction diagrams.
8 Interaction DiagramsSequence diagram: shows how objects communicate with each other in terms of a sequence of messages. Also indicates the lifespans of objects relative to those messages.Timing diagrams: are a specific type of interaction diagram, where the focus is on timing constraints.
9 Class Diagrams The main building block in object oriented modeling They are used both for general conceptual modeling of the systematics of the application, and for detailed modeling translating the models into programming codeThe classes in a diagram represent both the main objects and/or interactions in the application and the objects to be programmedIn the diagram these classes are represented with boxes which contain three parts
10 Class Diagrams A class with three sections. The upper part holds the name of the classThe middle part contains the attributes of the classThe bottom part gives the methods or operations the class can take or undertake
11 Class DiagramsIn the system design of a system, a number of classes are identified and grouped together in a class diagram which helps to determine the static relations between those objectsWith detailed modeling, the classes of the conceptual design are often split in a number of subclassesIn order to further describe the behavior of systems, these diagrams can be complemented by state diagram or UML state machineAlso instead of class diagrams, Object role modeling can be used if you just want to model the classes and their relationships
12 The class icon Defines The class icon has Persistent system stateSystem behaviorThe class icon hasNameAttributesOperationsIt’s a rectangle divided into three compartments.
13 Steps followed Draw class symbol in the editor and name it List the class attributesList the class operations/methodsMake the links and associationsGive notations
14 Structural Modeling: Core Elements Reference: OMG tutorial on UML by Cris Kobryn
15 Structural Modeling: Core Elements (cont’d) ¹ An extension mechanism useful for specifying structural elements.Reference: OMG tutorial on UML by Cris Kobryn
16 Structural Modeling: Core Relationships Reference: OMG tutorial on UML by Cris Kobryn
17 Structural Modeling: Core Relationships (cont’d) Reference: OMG tutorial on UML by Cris Kobryn
18 Interfaces: Longhand Notation Fig. 3-29, UML Notation GuideReference: OMG tutorial on UML by Cris Kobryn
19 Associations An Association represents a family of links Binary associations (with two ends) are normally represented as a line, with each end connected to a class boxHigher order associations can be drawn with more than two ends; in such cases, the ends are connected to a central diamondFig. 3-40, UML Notation GuideReference: OMG tutorial on UML by Cris Kobryn
20 AssociationsAn association can be named, and the ends of an association can be adorned with role names, ownership indicators, multiplicity, visibility, and other propertiesThere are five different types of association; bi-directional and uni-directional associations are the most common onesFig. 3-40, UML Notation GuideReference: OMG tutorial on UML by Cris Kobryn
21 AggregationsAggregation is a variant of the "has a" or association relationship; aggregation is more specific than associationIt is an association that represents a part-whole or part-of relationship. As a type of association, an aggregation can be named and have the same adornments that an association canHowever, an aggregation may not involve more than two classes
22 AggregationsAggregation can occur when a class is a collection or container of other classes, but where the contained classes do not have a strong life cycle dependency on the container—essentially, if the container is destroyed, its contents are notIn UML, it is graphically represented as a hollow diamond shape on the containing class end of the tree of lines that connect contained class(es) to the containing class
23 Composition Fig. 3-45, UML Notation Guide Composition is a stronger variant of the "owns a" or association relationship; composition is more specific than aggregationIt is represented with a solid diamond shapeHas a strong life cycle dependency between instances of the container class and instances of the contained class(es): If the container is destroyed, normally every instance that it contains is destroyed as wellNote that a part can (where allowed) be removed from a composite before the composite is deleted, and thus not be deleted as part of the compositeThe UML graphical representation of a composition relationship is a filled diamond shape on the containing class end of the tree of lines that connect contained class(es) to the containing classFig. 3-45, UML Notation GuideReference: OMG tutorial on UML by Cris Kobryn
24 GeneralizationIndicates that one of the two related classes (the subtype) is considered to be a specialized form of the other (the super type) and supertype is considered as 'Generalization' of subtypeIn practice, this means that any instance of the subtype is also an instance of the supertypeAn exemplary tree of generalizations of this form is found in binomial nomenclature: human beings are a subtype of simian, which are a subtype of mammal, and so on. The relationship is most easily understood by the phrase 'A is a B' (a human is a mammal, a mammal is an animal).Fig. 3-47, UML Notation GuideReference: OMG tutorial on UML by Cris Kobryn
25 GeneralizationThe UML graphical representation of a Generalization is a hollow triangle shape on the supertype end of the line (or tree of lines) that connects it to one or more subtypes.The generalization relationship is also known as the inheritance or "is a" relationship.The supertype in the generalization relationship is also known as the "parent", superclass, base class, or base type.The subtype in the specialization relationship is also known as the "child", subclass, derived class, derived type, inheriting class, or inheriting type.Fig. 3-47, UML Notation GuideReference: OMG tutorial on UML by Cris Kobryn
26 GeneralizationNote that this relationship bears no resemblance to the biological parent/child relationship: the use of these terms is extremely common, but can be misleadingGeneralization-Specialization relationshipA is a type of BE. g. "an oak is a type of tree", "an automobile is a type of vehicle"Generalization can only be shown on class diagrams and on Use case diagrams.Fig. 3-47, UML Notation GuideReference: OMG tutorial on UML by Cris Kobryn
27 DependenciesDependency is a weaker form of relationship which indicates that one class depends on another because it uses it at some point of timeIt exists if a class is a parameter variable or local variable of a method of another classFig. 3-50, UML Notation GuideReference: OMG tutorial on UML by Cris Kobryn
34 Object DiagramA diagram that shows a complete or partial view of the structure of a modeled system at a specific timeFocuses on some particular set of object instances and attributes, and the links between the instances
35 Object DiagramA set of objects (instances of classes) and their relationshipsA static snapshot of a dynamic view of the systemRepresents real or prototypical casesVery useful before developing class diagramsWorth saving as elaborations of class diagrams
36 Instance Specifications Each object and link is represented by an Instance SpecificationThis can show an object's classifier (e.g. an abstract or concrete class) and instance name, as well as attributes and other structural features using slotsEach slot corresponds to a single attribute or feature, and may include a value for that entity
37 Instance Specifications The name on an instance specification optionally shows …an instance name, a ':' separator, and optionally one or more classifier names separated by commasThe contents of slots, if any, are included below the names, in a separate attribute compartmentA link is shown as a solid line, and represents an instance of an association
38 ExampleAs an example, consider one possible way of modeling production of the Fibonacci sequence
39 ExampleIn the first UML object diagram, the instance in the leftmost instance specification …is named v1,has IndependentVariable as its classifier,plays the NMinus2 role within the FibonacciSystem, andhas a slot for the val attribute with a value of 0
40 Example The second object … is named v2, is of class IndependentVariable,plays the NMinus1 role, andhas val = 1
41 Example The DependentVariable object … is named v3, and plays the N role
42 Example The topmost instance, an anonymous instance specification, … has FibonacciFunction as its classifier, andmay have an instance name, a role, and slots, but these are not shown here
43 Example The diagram also includes three named links, shown as lines Links are instances of an association
44 ExampleAfter the first iteration, when n = 3, and f(n-2) = 1, and f(n-1) = 1, then f(n) = = 2At a slightly later point in time, the IndependentVariable and DependentVariable objects are the same, but the slots for the val attribute have different valuesThe role names are not shown here
45 ExampleAfter several more iterations, when n = 7, and f(n-2) = 5, and f(n-1) = 8, then f(n) = = 13In a still later snapshot, the same three objects are involvedTheir slots have different valuesThe instance and role names are not shown here
46 UsageIf you are using a UML modeling tool, you will typically draw object diagrams using some other diagram type, such as on a class diagramAn object instance may be called an instance specification or just an instanceA link between instances is generally referred to as a linkOther UML entities, such as an aggregation or composition symbol (a diamond) may also appear on an object diagram