900 likes | 1.17k Views
Unified Modeling Language. a language for specifying , constructing , visualizing and documenting the artifacts of a software-intensive system also for Business Modeling and other non-software systems Authors :Grady Booch, Jim Rumbaugh and Ivar Jacobson
E N D
Unified Modeling Language • a language for specifying, constructing, visualizing and documenting the artifacts of a software-intensive system • also for Business Modeling and other non-software systems • Authors :Grady Booch, Jim Rumbaugh and Ivar Jacobson • Stems out from : Booch, OMT, OOSE (and others)
UML 1.3 OMG Acceptance, Nov 1997 UML 1.1 Final submission to OMG, Sep ‘97 First submission to OMG, Jan ´97 UML 1.0 UML partners public feedback UML 0.9 Web - June ´96 Unified Method 0.8 OOPSLA ´95 OOSE Other methods Industrialization • History Standardization Unification Fragmentation Booch method OMT
Goals • ready-to-use, expressive visual modeling language • extensibility and specialization mechanisms to extend the core concepts • independent of particular programming languages and development process • formal basis for understanding the modeling language • encourage the growth of the OO tools (CASE) market • support higher-level development concepts such as collaboration, frameworks, patterns and components • integrate best practices
Outside the scope of UML • Programming languages • the UML is a modeling language, not programming • its aim is not to capture all necessary constructs of programming languages • Tools • the UML defines a semantic metamodel, not an tool interface, storage or run-time model • the UML documents do include some tips to tool vendors (implementation choices), but do not address everything • Process • the UML is intentionally process independent, and defining a standard process was not a goal of UML • UML is a common language for priject artifacts, developed in the context of different processes
Artifacts • UML Semantics • description of the UML metamodel, i.e. a model defining a language • Abstract syntax • Well formedness rules • Semantics • UML Notation Guide • graphical notation and textual syntax of “visual” elements of the UML language • UML Extensions • language extensions for Objectory Process, Business Modeling, etc.
UML Generic mechanisms/Diagram elements • Graphs and their contents • Strings • Name • Label • Keywords • Expression (OCL Expression) • Note • Type-instance correspondence
Graphs and their contents • UML diagrams • are graphs containing nodes connected by paths. • the information is mostly in the topology (exception: a sequence diagram with a metric time axis) • Graphical constructs used in UML notation: • icon, two-dimensional symbols, drawing paths • strings
Graphs and their contents • Invisible hyperlinks and the role of tool • a notation may contain additional invisible hyperlinks that are not apparent in a static view • a dynamic notation - out of scope of the UML • Background information • each appearance of a symbol may have its own presentation choices • information presented in a textual or tabular format • presenting tabular information is a tool responsibility (out of scope of UML)
Strings • a sequence of characters • they map underlying model strings, although some strings may exist purely on the diagrams Example • BankAccount • integrate (f: Function, from: Real, to: Real) Name • a string, that uniquely identifies a model element within some scope • a pathname = names linked by a delimiter (e.g. ‘::’) Example • integrate • MathPak::Matrices::BandedMatrix.dimension
label Label • a string that is attached to a graphic symbol • it is purely a notational term Example Keywords • used to distinguish variations on a common theme • general notation is : «keyword» Example • <<stereotype>>
Expression • expressed as strings in a particular language • the OCL is used within the UML semantic definition • linguistic formulas yielding values Example • BankAccount * (*) (Person*, int) • [ i > j and self.size > i ] OCL Expression • used to define constraints (within the UML metamodel itself) Example • flight.pilot.training_hours > flight.plane.minimum_hours • company.employees->select (title = ”Manager” and self.reports->size > 10)
Note • a graphical symbol containing textual information • a notation for rendering constraints,comments, method bodies, and tagged values • is a notational item Example
type instance (object) Type-instance correspondence • a major purpose of modeling is to prepare generic descriptions that describe many specific particular items -> type-instance dichotomy • in UML the type-instance distinction is shown by employing the same symbol and by underlining the name string of an instance element. Example
Generic mechanisms/Model management Packages • may contain packages and ordinary model elements • some packages may be Subsystems or Models • the basis for configuration control, access control • element can be directly owned by a single package • stereotypes system, facade, framework, top package • the visibility (‘+’ public, ‘-’ private, ‘#’ protected) • dependency between packages => dependencies among the elements
package dependency Example (of packages)
General extension mechanisms • represents general purpose mechanisms that may be applied to any modeling element • an extensibility device for UML • Constraint • Comment • Tagged values • Stereotypes
Constraint • represents semantic information attached to a model element - conditions to be maintained as true • is shown as a text string in braces ( { } ) • a predefined language for writing constraints is OCL • a user-defined constraint is described in words in a given language • Stereotypes: <<invariant>>, <<postcondition>>, <<precondition>> • Comment • a text string attached directly to a model element. • attaches arbitrary textual information to any model element • Stereotypes: <<requirement>>,<<responsibility>>
comment constraint Example (constraints & comments)
Tagged values • a mechanism to define new element properties • a property is a value attached to a model element • a keyword-value pair => tag-value Example • { author = ”Joe Smith”, deadline = 31-March-1997, status = analysis } or { abstract } Stereotype • built-in extensibility mechanisms of UML • a new class (subclass of an existing ) of modelling elements introduced at modelling time • notation • a key-word string (within guillemets,e.g. «foo».) • a special graphic icon
Static structure diagrams • Class diagrams • show the static structure of the model, • contain classes, interfaces, packages, relationships • also known as “static structural diagrams” • are organized into packages • Static object diagram • a graph of instances • an instance of a class diagram - a snapshot of the state of a system at a point in time • shows examples of data structures
Concepts to be discusssed • Class • Attribute and Operation • Interface, Parameterized class, Utility • Type vs. Implementation class • Importing a package • Object • {Bin, N}-ary Association • Association end, Aggregation, Composition, Multiplicity, Qualifier, Association class • Generalization • Dependency • Derived element
Class • the descriptor for a set of objects with similar structure, behavior, and relationships • represents a concept within the modeled system • classes have data structure and behavior and relationships to other elements • the name of a class has scope within the package in which it is declared => the name must be unique Notation • rectangle with 3 compartments • name and general properties, attributes, operations • a reference to a class => Package-name::Class-name
name compartment (standard) list compartment (user defined) list compartment Example (of classes)
Attribute • is semantically equivalent to a composition association (the intent and usage is normally different) Notation visibility name [multiplicity]: type = default {property-string} • visibility = {+ public, # protected, - private} • property-stringindicates property values, e.g. • {frozen} - a nonchangeable attribute • a class-scope attribute - underlined or preceded with $ • multiplicity • if absent an attribute holds exactly 1 value • e.g. name [0..1]: String (permits a distinction between the null value and the empty string)
Operation • a service that an instance of the class may be requested to perform Notation visibility name ( parameter-list ) : return {property-string} • parameter-listis a comma-separated list of • kind name : type-expression = default-value • kind is in, out, or inout, with the default in if absent • property-stringindicates property values, e.g. • {query} - operation does not modify the system state • {sequential}, {guarded}, {concurrent} • {abstract} - the class does not implement the operation • stereotype «signal» indicates that the class accepts the given signal (with operation name)
Type vs. Implementation class • Type • is a specification of externally visible behavior of a set of objects • Implementation Class • defines the physical data structure and procedures of an object • an object may have multiple Types but only one Implementation Class (which is fixed) • the implementation of a type by an implementation class is modeled as the Realizes relationship (this implies inheritence of operations, not of structure)
Interface • is a specifier for the externally-visible operations of a class, component, or other entity (e.g. packages) • does not have implementation • may have generalization relationships Example
Parameterized class & Bound element • Template • the descriptor for a class with unbound formal parameters • defines a family of classes (but, is not a directly-usable class) • attributes and operations are defined in terms of the parameters • Bound element • template’s parameters are bound to actual values. • fully specified by its template (content may not be extended) Example
Utility • is a grouping of global variables and procedures • attributes and operations are interpreted as being at class scope Example • Metaclass • is a class whose instances are classes • shown as the stereotype «metaclass» of Class
Importing a package • the contents of the target packages (and its sub-packages) may be referenced by the client package • does not modify the namespace of the client • the visibilities are combined according to the rule that the most restrictive visibility in the set is obtained • represented by «imports» dependency relation Example
Object • represents a particular instance of a class • has identity and attribute values Example
Binary Association • is an association among exactly two classes (including a reflexive association) • predefined constraints, e.g. {or} Notation • consists of • association ends (2), name, association class (optional) Example
Association end • an end of an association where it connects to a class • each association has two or more ends Notation • kinds of adornments of an association end: • multiplicity • ordering • the set of related elements can be {ordered},{unordered} • qualifier • navigability • aggregation (a diamond) • rolename • indicates the role played by the class • changeability of the links, e.g. {frozen} or {addOnly} • visibility
Aggregation and composition • aggregation (a diamond) • a whole-part relationship • also treated as an ownership by reference • composition (a filled-diamond • aggregation with strong ownership and coincident lifetime as part of the whole • parts : • may be created after the composite itself • they live and die within the whole • can be explicitly removed before the death of the whole • the multiplicity of the aggregate end may not exceed one (it is unshared) • also treated as an ownership by value
Multiplicity • specifies the range of allowable cardinalities that a set may assume • a comma-separated sequence of integer intervals • lower-bound .. upper-bound, a number, * - many Qualifier • an attribute or list of attributes whose values serve to partition the set of objects associated with an object across an association • multiplicity • “0..1” - a unique value may be selected, but every possible qualifier value does not necessarily select a value • “1” - every possible qualifier value selects a unique target • “*” - the qualifier value is an index that partitions the target objects into subsets
Association class • an association that also has class properties • it is a single model element (association + linked class) Example
N-ary association • an association among 3 or more classes • may not contain the aggregation marker Example • This example shows the record of a team in each season with a particular goalkeeper.The goalkeeper might be traded during the season and can therefore appear with different teams.
Generalization • taxonomic relationship between a more general element and a more specific element that is fully consistent with the first element and that adds additional information. Notation • discriminator • the name of a partition of the subtypes of the superclass. • constraints • {overlapping} - inheritence from more subclasses allowed • {disjoint} - inheritence from more subclasses NOT allowed • {complete} - all subclasses have been specified • {incomplete} - there are additional subclasses that are not yet in the model
Dependency • indicates a semantic relationship between two (or more) model elements • predefined kinds • trace - connects the same concept at different levels of meaning (history) • refine • uses - operation calling, instantiating, etc. • bind - binding of template parameters to actual values Example
Derived element • is one that can be computed from another one • is shown for clarity or for design purposes • adds no semantic information Example
Process of static structure modelling • Identify classes • from Glossary • from Business Model • stored information items • from use case realizations • Specify the semantics of classes • responsibility • attributes, operations and interfaces • Identify relationships among classes • domain based associations • object interactions • generalization and aggregation relationships • Structure the model into packages
Interaction diagrams • Sequence siagrams • Collaboration diagram • show a pattern of interaction among objects • they express similar information but show it in different ways • Multiobject • Message flow
Sequence siagrams • show an interaction arranged in time sequence • show the sequence of messages exchanged among objects • for real-time specifications and complex scenarios Collaboration diagram • represents a Collaboration and an Interaction • Collaboration • a set of objects related in a particular context • context is a collaboration diagram without messages • Interaction • a set of messages exchanged among the objects within a collaboration to effect a desired operation or result. • shows an interaction organized around the objects • does not show time as a separate dimension • may be attached to an operation or a use case