1 / 45

Chapter 2, Modeling with UML: UML 2 Hightlights

Chapter 2, Modeling with UML: UML 2 Hightlights. Outline for today. UML 2: UML is a living language Overview of important changes in UML 2 Frames and nesting of Frames Activity diagrams Deployment diagrams Sequence diagrams Stereotypes. Recent History of UML.

sivan
Télécharger la présentation

Chapter 2, Modeling with UML: UML 2 Hightlights

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 2,Modeling with UML:UML 2 Hightlights

  2. Outline for today • UML 2: UML is a living language • Overview of important changes in UML 2 • Frames and nesting of Frames • Activity diagrams • Deployment diagrams • Sequence diagrams • Stereotypes

  3. Recent History of UML

  4. UML now usable with Model Driven Architecture (MDA) • Better support for the automatic transformation of a Platform Independent Model (PIM) into a Platform Specific Model (PSM) • UML 2 is based on a meta model • Meta Object Facility (MOF)

  5. Changes in UML 2 • Frames and nesting • Changes in diagram notations • Activity diagram • Deployment diagram • Sequence diagram • New diagram types (Not covered in this lecture) • Composite structure diagrams • Timing diagrams

  6. Frames: Notation for all UML 2 Diagrams • Mandatory is now the contents area • Optional: The contents area can be surrounded with frame and a heading Frame • <heading> ::= [<diagram kind>]<name>[<parameters>]

  7. Activity diagram Class diagram Component diagram Interaction diagram Package state machine diagram Use case diagram The following abbreviations are usually used for diagram frames: act (for activity frames) cmp (for component frames) sd (for interaction frames) pkg (for package frames) stm (for state machine frames) uc (for use case frames) Diagram Kinds Diagram Notation

  8. Nested Diagrams • UML 2 supports nested diagrams • e.g. an activity diagram can be inside a class • The frame concept visually groups elements that belong to one diagram

  9. Example of a Activity Diagram with a Frame

  10. The Activity Diagram without Frame

  11. UML Activity Diagrams An activity diagram consists of nodes and edges • There are three types of activity nodes • Control nodes • Executable nodes • Most prominent: Action • Object nodes • E.g. a document • An edge is a directed connection between nodes • There are two types of edges • Control flow edges • Object flow edges

  12. UML Activity Diagrams An activity diagram consists of nodes and edges • There are three types of activity nodes • Control nodes (special icon) • Executable nodes (an oval) • Most prominent: Action • Object nodes • E.g. a document (a rectangle) • An edge is a directed connection between nodes • There are two types of edges • Control flow edges • Object flow edges

  13. Control Node Icons in an Activity Diagram • Initial node • Final node • Activity final node • Flow final node • Fork node • Join node • Merge node • Decision node

  14. Activity Diagram Example Decision node Fork node Join node Merge node Initial node Final node

  15. Activity Diagram: Activity Nodes & Edges • An activity diagram consists of nodes and edges • There are three types of activity nodes • Control nodes • Executable nodes • Most prominent: Action • Object nodes • E.g. a document • An edge is a directed connection between nodes • There are two types of edges • Control flow edges • Object flow edges

  16. Action Nodes and Object Nodes • Object Node • Action Object Name Action Name Thesis ReviewThesis Write Thesis

  17. Activity Diagram Example Action Object node

  18. Activity Diagram: Activity Nodes & Edges • An activity diagram consists of nodes and edges • There are three types of activity nodes • Control nodes • Executable nodes • Most prominent: Action • Object nodes • E.g. a document • An edge is a directed connection between nodes • There are two types of edges • Control flow edges • Object flow edges

  19. Activity Diagram Example Control flow edge Object flow edge

  20. Summary: Activity Diagram Example Decision node Fork node Join node Merge node Initial node Control flow edge Final node Action Object node Object flow edge

  21. Activity Diagram: Pins Pin: Alternative notation for an object node • Different notations with same semantics Thesis ReviewThesis Write Thesis Thesis Thesis • Both notations define object flow in an activity. ReviewThesis Write Thesis

  22. Outline for today • UML 2: UML is a living language • Overview of important changes in UML 2 • Frames and nesting • Activity diagrams • Deployment diagrams • Sequence diagrams • Stereotypes

  23. UML 2 Deployment Diagrams • Two node types: • Device • Execution environment

  24. Deployment Diagram Changes II • Artifacts can now manifest any packageable element, not just components • Manifestation is shown by a dependency with keyword «manifest»

  25. Deployment Diagram Changes III • A deployment diagram can have a deployment specification

  26. Activity diagram Class diagram Component diagram Interaction diagram Package state machine diagram Use case diagram The following abbreviations are usually used for diagram frames: act (for activity frames) cmp (for component frames) sd (for interaction frames) pkg (for package frames) stm (for state machine frames) uc (for use case frames) Diagram Kinds

  27. Interaction Diagrams • New concept of interaction fragments • Before we go into detail with interaction fragments, let’s cover the concept of an interaction.

  28. Interaction Diagrams • Four types of interaction diagrams: • Sequence diagrams • Communication diagrams • Interaction overview diagrams • Timing diagrams • The basic building block of an interaction diagram is the interaction • An interaction is a unit of behavior that focuses on the observable exchange of information between connectable elements

  29. Interactions • UML Interactions are primarily used during analysis to get a better understanding of the interactions between entity objects • Interactions are also used during the detailed design activity (object design), especially if precise inter-process communication must be set up according to formal protocols • Interactions can finally be used during testing to describe the desired behavior of a system to compare it with the observed behavior.

  30. Example of an Interaction: Sequence Diagram

  31. Interaction Fragment • Interaction Fragment • Is a piece of an interaction • Acts like an interaction itself • Combined Fragment • Is a subtype of interaction fragment • defines an expression of interaction fragments • An expression of interaction fragments is defined by • an interaction operator and interaction operands.

  32. Interaction Operators • A combined fragment defines an expression of interaction fragments. The following operators are allowed in a combined fragment expression: • alt • opt • par • loop • critical • neg • assert • strict • seq • Ignore • consider

  33. Alt Operator • The interaction operator alt indicates a choice of behavior between interaction fragments • At most one interaction fragment (that is, an InteractionOperand) is chosen • The chosen interaction fragment must have an explicit or implicit guard expression that evaluates to true at this point in the interaction • A guard can be • a boolean expression (called InteractionConstraint) • else (a reserved word) • If the fragment has no guard expression, true is implied.

  34. Example of a Combined Fragment using alt

  35. Opt and Break Operators option: The interaction operator optdesignates a choice of behavior where either the (sole) operand happens or nothing happens. break: The interaction operator breakrepresents a breaking scenario: The operand is a scenario that is performed instead of the remainder of the enclosing interaction fragment.

  36. Parallel and Critical Operator par The interaction operator pardesignates a parallel merge between the behaviors of the operands of a combined fragment. critical The interaction operator criticaldesignates that the combined fragment represents a critical region.

  37. Example of a Critical Region Problem statement: The telephone Operator must make sure to forward a 911-call from a Caller to the Emergency system before doing anything else. Normal calls can be freely interleaved.

  38. One more thing: Modeling Real-Time Constraints • The duration of a message and the duration between two event occurrences can be constrained with a time constraint.

  39. Where are we? • Introduction • Frames and nesting • Changes in diagram notation: • Activity diagram • Deployment diagram • Sequence diagram • Profiles and stereotypes

  40. More on meta classes and meta modeling in the next lecture (today or on Friday) Stereotype • Defines how an existing meta class may be extended • A meta class may be extended by one or more stereotypes • Why do we want to do this? • Example: • Insertion of solution domain abstractions in the model (such as platform specific classes) • Sterotypes allow a clear separation from the application domain abstractions.

  41. Stereotype Notations • A stereotype is a string enclosed in guillemets before the classifier name • E.g. «Clock» StopWatch, «boundary» button • Stereotypes can also be represented with a graphical icon • The icon can even replace the standard notation (icons for a class, object, use case, etc).

  42. Icons and Symbols for Stereotypes • One can use icons or graphical symbols for stereotypes • When the stereotype is applied to a UML model element, the graphic replaces the standard notation for the model element • Example: Modeling a network, use icons for representing classes of type Switch, Server, Router, Printer Icon for Router class Icon for Switch class Icon for Server Class

  43. Pros and Cons of Stereotype Graphics • Advantages: • UML diagrams may be easier to understand if they contain graphics and icons for stereotypes • This can increase the readability of the diagram, especially if the client is not trained in UML • And they are still UML diagrams! • Disadvantages: • If developers are unfamiliar with the symbols being used, it can become much harder to understand what is going on • Especially in high level management presentations • Additional symbols add to the burden of learning to read the diagrams • If you end up applying stereotypes all over your model, you should think of defining a profile (see next lecture).

  44. Stereotypes vs. Keywords • Not to be mixed up with keywords • Same notation (String enclosed in guillemets) • «interface» is no stereotype! • «extend» is no stereotype! • See Annexes B and C of the UML Superstructure specification.

  45. Additional Readings • UML 2.2 specification • The specification consists of two complementary parts which constitute the complete speciication of UML 2: • Infrastructure and Superstructure. • The infrastructure specification defines the foundational language constructs • http://www.omg.org/spec/UML/2.2/Infrastructure/PDF • The superstructure defines the user level constructs. • http://www.omg.org/spec/UML/2.2/Superstructure/PDF • For a complete list of all UML specifications, see • http://www.omg.org/spec/UML/

More Related