Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Uml Omg Fundamental Certification 5


Published on

Published in: Technology, Education
  • Be the first to comment

Uml Omg Fundamental Certification 5

  1. 1. UML 2-OMG certification course (OCUP Fundamental-4) Instructor: M.C. Ricardo Quintero
  2. 2. Interaction Diagrams <ul><li>The topics described in this section refer to the following metamodel areas: </li></ul><ul><ul><li>Package Interactions::BasicInteractions </li></ul></ul><ul><ul><ul><li>Interactions </li></ul></ul></ul><ul><ul><ul><li>Lifelines </li></ul></ul></ul><ul><ul><ul><li>Messages </li></ul></ul></ul><ul><li>The topic area constitutes 20 percent of the test. </li></ul>
  3. 3. Interactions <ul><li>Def.- An interaction describes a series of messages that a selected set of participants exchange within a situation limited in time. </li></ul>
  4. 4. Interactions <ul><li>UML 2.0 defines four diagrams to represent interactions: </li></ul><ul><ul><li>Sequence diagrams : emphasize the sequence in which messages are exchanged. (*) </li></ul></ul><ul><ul><li>Communication diagrams : emphasize the relationship between the participants . </li></ul></ul><ul><ul><li>Timing diagrams : emphasize the state changes of the participants relative to the time and the messages exchanged. </li></ul></ul><ul><ul><li>Interaction overview diagrams : present the order of interactions in an activity-like notation. </li></ul></ul><ul><ul><li>(*) The most important to the Fundamental certification level </li></ul></ul>
  5. 5. Notation & Semantics <ul><li>The most important aspect in sequence diagrams is the time of messages . </li></ul><ul><li>Each participant is represented by a rectangle and a vertical dashed line called lifeline . </li></ul><ul><li>Messages are represented by arrows between lifelines. </li></ul><ul><li>The time runs from top to bottom, showing the time of message flows . </li></ul>
  6. 6. Simple example of a sequence diagram sd Identify Authorized Person log() ok:Boolean Lifelines Only 1 interaction Local attribute
  7. 7. The lifeline metamodel
  8. 8. Connectable elements <ul><li>The name in the header of the lifeline is not underlined because lifelines represent connectable elements . </li></ul><ul><li>They describe instances located in the classifier to which the interaction belongs. So it’s not bad idea if you think of the lifelines as objects of the specified types (as in UML 1.x). </li></ul>
  9. 9. Multiobjects <ul><li>The header of a lifeline shows (optionally) the element name , together with the pertaining classifier (name:type). </li></ul><ul><li>A lifeline always represent exactly one element (so the Multiobjects of 1.x are not permited ). </li></ul><ul><li>Of course, a lifeline can represent an element from a multivalued property . </li></ul><ul><li>In order to select one specific element , you have to state a selector . </li></ul><ul><li>The header of lifeline can also show the keyword self , which represents an instance of the classifier to which the interaction belongs </li></ul>
  10. 10. Lifelines & set types res[2]:BookingList :BookingList :Booking A set type Using a selector to select one element from a set type Multiobjects 1.x not permited
  11. 11. Execution occurrence <ul><li>When messages are exchanged between lifelines, then a behavior in the participating elements has to be executed . </li></ul><ul><li>This behavior is represented by oblong rectangles on the lifelines and represent the execution occurrence . </li></ul><ul><li>The beginning and the end of an execution occurrence are defined by event occurrences . </li></ul><ul><li>The sending and receiving of messages determine the beginning and the end of an execution occurrence . </li></ul>
  12. 12. The metamodel for event occurrences
  13. 13. Notation forms for various message types S T asynchronous call(syncronous) reply lost message found message U new
  14. 14. Message sintax <ul><li>[attribute=] name [(arguments)][:return value]|’*’ </li></ul><ul><li>Where: </li></ul><ul><li>attribute : can a be a local variable or an instance fo a lifeline. Is used only for synchronous messages with return values. </li></ul><ul><li>name : the name of the called message or the name of the signal sent. Signal sending is always asynchronous. </li></ul><ul><li>arguments : list of parameters, separated by commas. Sintax: </li></ul><ul><li>[parameter=]value (for in parameters) </li></ul><ul><li>Attribute=output parameter[:output value] (for out , inout or return ) </li></ul><ul><li>‘ -’ </li></ul><ul><li>(used when the value is unknown and when it doesn’t play a role for the interaction) </li></ul><ul><li>Instead of the message you can specify an asterisk (*). It’s a kind of joker for any message . </li></ul>
  15. 15. Message examples <ul><li>message(4,-,2,”HelloWorld!”) </li></ul><ul><li>X=calculate(17,bpos):42 </li></ul><ul><li>message(arg=2003) </li></ul>
  16. 16. Destroying objects <ul><li>The destruction of an object is a special event ocurrence (see the metamodel). </li></ul>
  17. 17. The metamodel for messages
  18. 18. Event ocurrence: sending and receiving messages <ul><li>Event ocurrences that arise immediately upon sending and receiving messages are more important than a stop for the certification . </li></ul><ul><li>Sending is an event , as is Receiving . </li></ul><ul><li>These events are used to define the semantics of an interaction that can be described by two sets . </li></ul>
  19. 19. Event ocurrence: sending and receiving messages <ul><li>One set contains the valid sequences of send and receive events. </li></ul><ul><li>The other set contains invalid sequences . </li></ul><ul><li>All remaining sequences are irrelevant for the interaction. </li></ul>
  20. 20. Example of sequences-valid sequences Interaction Example S T p r p! p* q! r* r! q Secuencias válidas de interacción: <p!,p*,q!,r!, r*, q*> <p!, r!, p*, q!, r*, q*>
  21. 21. Rules to determine valid sequences <ul><li>Before a receive event , there must always be the pertaining send event first . </li></ul><ul><li>The sequence along one lifeline is relevant . In contrast, the position of one event relative to an event on another lifeline is insignifcant . </li></ul><ul><ul><li>Ex.- Thought event r! comes after q! , r! can nevertheless happen first. </li></ul></ul>
  22. 22. General ordering <ul><li>Is possible to use the GeneralOrdering relationship to influence the sequence of events . </li></ul><ul><li>GeneralOrdering is a relationship between two events , bringing these events into a time sequence. </li></ul><ul><li>The relationship is drawn as a dotted line between a centered filled triangle, showing the direction between the two events involved. </li></ul><ul><li>The triangle points to the later of the two events. </li></ul>
  23. 23. Adding a GeneralOrdering relationship to the example Interaction Example S T p r p! p* q! r* r! q Provoca que la secuencia ahora sea inválida, porque el evento r! tiene que ocurrir antes que p* <p!,p*,q!,r!, r*, q*>
  24. 24. StateInvariant <ul><li>The exchange of messages can causes the states of instances represented by lifelines to change . </li></ul><ul><li>This can be denoted by state invariants . </li></ul>
  25. 25. The metamodel for interactions
  26. 26. State Invariants on a lifeline S State X {self.list->size().notEmpty()} {self.listA->size()> self.listB->size()}
  27. 27. Structure of interactions <ul><li>The metamodel class Interaction owns the elements Message and Lifeline . </li></ul><ul><li>The abstract superclass of Interaction and other elements, such as EventOcurrence , is InteractionFragment . </li></ul><ul><li>The entire structure of an interaction is formed by means of the composite pattern . </li></ul>
  28. 28. Checklist: Interaction diagrams <ul><li>What is an interaction? </li></ul><ul><li>What does a lifeline represent? </li></ul><ul><li>What does self mean in a lifeline? </li></ul><ul><li>What is an execution ocurrence? </li></ul><ul><li>What types of message are there? </li></ul><ul><li>What is a stop? </li></ul><ul><li>What events are triggered by an exchange of messages? </li></ul>
  29. 29. Checklist: Interaction diagrams <ul><li>How is the semantics of an interaction defined? </li></ul><ul><li>How many valid event sequences can an interaction have? </li></ul><ul><li>What rules determine valide event sequences? </li></ul><ul><li>What does the GeneralOrdering relationship express? </li></ul><ul><li>What is a state invariant? </li></ul><ul><li>How are state invariants denoted? </li></ul>
  30. 30. Diagramas de comunicación <ul><li>Emphasizes the relationship of the participants rather than the time sequence of the exchange of messages as in sequence diagrams. </li></ul>
  31. 31. Example of a communication diagram Interaction System start :System :Subsystem2 :SubSystem1 2:initialize() 1:initialize()
  32. 32. Timing diagram <ul><li>Is another view on the interaction model. It emphasizes timing aspects; in particular, the state change of the lifelines at specific times. </li></ul><ul><li>The states are state invariants in the interaction model. </li></ul>
  33. 33. Example of a timing diagram
  34. 34. Interaction overview diagram <ul><li>It looks like an activity diagram. </li></ul><ul><li>However it is an interaction diagram that uses the same notation. </li></ul><ul><li>The nodes are interactions or interaction uses . </li></ul><ul><li>The diagram specifies the executing order of interactions . </li></ul>
  35. 35. Example of an interaction overview diagram
  36. 36. Use cases <ul><li>The topics discussed in this section refer to the following areas of the metamodel: </li></ul><ul><ul><li>Package: UseCases </li></ul></ul><ul><ul><ul><li>Actors </li></ul></ul></ul><ul><ul><ul><li>Include and extend relationships </li></ul></ul></ul><ul><ul><ul><li>The classifiers of a use case </li></ul></ul></ul><ul><ul><ul><li>Other use case concepts </li></ul></ul></ul><ul><li>This topic area constitutes 20 percent of the test. </li></ul>
  37. 37. Use cases & Actors <ul><li>Def. - A use case specifies a set of actions that are executed by a system or subject and that lead to a result . </li></ul><ul><li>An actor is a role outside the system or subject of the pertaining use case that interacts with the system in the context of the use case. </li></ul>
  38. 38. Notation & Semantics <ul><li>A use case diagram describes the relationships among a set of use cases and the actors participating in these use cases. </li></ul><ul><li>The diagram does not show sequence flow (though is possible define it textually or by activity diagrams) </li></ul>
  39. 39. Example of use case diagram
  40. 40. The metamodel for use cases and actors
  41. 41. Some terms used in use cases <ul><li>System : (is not a direct model element) refers to the context of a use case. It describes a classifier in which the actions specified by the use case are executed. Can be a class or a component that represents the entire application. </li></ul><ul><ul><li>Synonymous : use case context , subject , modeling focus and context . </li></ul></ul>
  42. 42. Some terms used in use cases <ul><li>Stakeholder : (is not a model element) it is a general term used to describe a person who has an interest in the system and who is especially interested in the results. </li></ul>
  43. 43. Notation for actors <<actor>> Actor External System The block (in the right) is not a UML symbol, is a user-specific symbol.
  44. 44. Associations <ul><li>A simple association is used to connect an actor and use cases . </li></ul><ul><li>The association expresses a communication path between the actor and the use case . </li></ul><ul><li>Directed associations are permitted. It is common for the navigation direction to point from the active to the passive part (from who initiated the communication). </li></ul>
  45. 45. Multiplicity <ul><li>Multiplicity on the side of the use case specifies how often this use case may be executed concurrently by the actor (default=0..1). </li></ul><ul><li>Multiplicity on the side of the actor , specifies how many actors with the specified roles must or can participate in the use case (default=1). </li></ul>
  46. 46. Several notations for use cases Use case Use case Use case Extension points Standard notation Using the name underneath the ellipse As a behaviored classifier. This representation is suitable, i.e., when a large number of extension points have to be defined
  47. 47. Representing the system underlying a use case <<subsystem>> Booking System Agent Book vechicle Cancel booking It is a component with the stereotype <<subsystem>>
  48. 48. A use case belonging to a classifier <<subsystem>> Booking System Book vechicle Cancel booking A use case can belong to a classifier, by a special Classifier model element enhanced by the property to own use cases
  49. 49. Checklist: Actors & Use cases <ul><li>What is the subject of a use case? </li></ul><ul><li>Can an actor be only a human user? </li></ul><ul><li>Name the base class of an actor in the metamodel? </li></ul><ul><li>Which notations are ther for an actor? </li></ul><ul><li>Name tha base class of a use case in the metamodel? </li></ul><ul><li>Which notations are there for a use case? </li></ul><ul><li>Who can own a use case? </li></ul>
  50. 50. Use case relationships <ul><li>Def.- An include relationship is used to integrate a use case into another use case, thus becoming a logical part of that use case. </li></ul><ul><li>An extend relationship is used to express that a use case will be extended by another use case in certain circunmstances, and at certain point, which is the extension point . </li></ul><ul><li>Use cases are special classifiers, they can be generalized and can be abstract . </li></ul>
  51. 51. The metamodel for use cases and actors (again...)
  52. 52. Include relationship <ul><li>Parts of use cases that occur identically in several use cases can be swapped into a separate use case , and then include relationship can be used to integrate the desired part in another use case. </li></ul><ul><li>It is not necessary that an actor be connected to an included use case. </li></ul>
  53. 53. Include relationship Pay out cash Identify authorized person <<include>> Pay out cash 1.Include:Identify authorized person 2.Determine pay-out amount 3. Check pay-out possibility 4. Pay out cash Identify authorized person 1. Read customer card 2. Check card lock 3. Ask for PIN 4. Check PIN
  54. 54. Extend relationship A extension points P B <<extend>> Condition:{boolean expression} extension point: p Use case A is extended by use case B at the extension point P under certain condition. If no condition is specified, then the extension will allways occur. It is not necessary that an actor be connected to the extended use case
  55. 55. Example of use case diagram with use case relationships Can you specify the kind of relationships (include or extend) of the dashed arrows?
  56. 56. Checklist: use case relationships <ul><li>In what direction does the include relationship point? </li></ul><ul><li>Does an included use case have to have an actor? </li></ul><ul><li>In what direction does the extend relationship point? </li></ul><ul><li>How many extension points can a use case define? </li></ul><ul><li>Does an extend relationship have to specify a condition? </li></ul><ul><li>Does an extended use case have to have an actor? </li></ul>