Unformatted text preview:

Interaction Diagram NotationObjectivesDecomposition ToolsObject-Oriented DecompositionIntroductionCommunication & Sequence DiagramsCommunication & Sequence Diagrams (2)Interaction Diagrams Are ValuableCommon Interaction Diagram NotationCommunication DiagramsExample Communication DiagramExample Communication Diagram: makePaymentBasic Communication Diagram NotationBasic Communication Diagram Notation (2)Communication Diagram from AgileModeling.comSequence DiagramsExample Sequence DiagramExample Sequence Diagram: make PaymentBasic Sequence Diagram NotationBasic Sequence Diagram Notation (2)Basic Sequence Diagram Notation (3)Basic Sequence Diagram Notation (4)Sequence Diagram from AgileModeling.comSequence Diagramming with Ideogramic Modeling ToolSequence Diagram for Java Remote Method Invocation http://nathanbalon.net/projects/cis578/cis578_middleware_report.pdfInteraction Diagram StrengthsInteraction Diagram WeaknessesConclusionsInteraction Diagram NotationFrom Chapter 15 of Craig Larman, Applying UML and PatternsJohn DalesandroObjectives•Read basic UML Interaction (Communication and Sequence) Diagram notationDecomposition Tools•Different styles of software development are often characterized by a strong reliance on a particular modeling tool during the design phase.•Relational Database designers tend to depend heavily on Entity Relationship Diagrams.•Functional/Procedural designers may use a tool like Function Decomposition Diagrams.•eXtreme Programming designers often use Class Responsibility Collaboration Cards.Object-Oriented Decomposition•The modeling genre of choice for most object-oriented designers is the Unified Modeling Language.•The most important activity in object-oriented design is assigning responsibility to objects.•The preferred tool to assist object-oriented designers in assigning responsibility to objects are the two UML interaction diagrams.Introduction•Why do objects exist?–To perform an activity to help fulfill a system’s purpose•Interaction Diagrams are used to model system dynamics–How do objects change state?–How do objects interact (message passing)?Communication & Sequence Diagrams•An Interaction Diagram is a generalization of two specialized UML diagram types–Communication Diagrams: Illustrate object interactions organized around the objects and their links to each other–Sequence Diagrams: Illustrate object interactions arranged in time sequenceCommunication & Sequence Diagrams (2)•Both diagram types are semantically equivalent, however, they may not show the same information–Communication Diagrams emphasize the structural organization of objects, while Sequence Diagrams emphasize the time ordering of messages–Communication Diagrams explicitly show object linkages, while links are implied in Sequence DiagramsInteraction Diagrams Are Valuable•Interaction Diagrams provide a thoughtful, cohesive, common starting point for inspiration during programming•Patterns, principles, and idioms can be applied to improve the quality of the Interaction DiagramsCommon Interaction Diagram NotationCommunication Diagrams•Objects are connected with numbered (sequenced) arrows along links to depict information flow•Arrows are drawn from the interaction source•The object pointed to by the arrow is referred to as the target•Arrows are numbered to depict their usage order within the scenario•Arrows are labeled with the passed messageExample Communication Diagram:ClassAInstance:ClassBInstance1: message1()2: message2()message1()Example Communication Diagram: makePayment:Register :Sale:Paymentdirection of messagefirst messagecreation indicated with a "create" messagefirst internal messageparameter instance link linemakePayment(cashTendered:<unspecified>) 1: makePayment(cashTendered:<unspecified>)1.1: create: (cashTendered:<unspecified>)Basic Communication Diagram Notation•Link - connection path between two objects (an instance of an association)•Message - represented with a message expression on an arrowed line between objects•Sequence Number - represents the order in which the flows are usedBasic Communication Diagram Notation (2)•Conditional Message–Seq. Number [ variable = value ] : message()–Message is sent only if clause evaluates to true•Iteration (Looping)–Seq. Number * [ i := 1..N ]: message()–“*” is required; [ ... ] clause is optionalCommunication Diagram from AgileModeling.comSequence Diagrams•Correspond to one scenario within a Use Case•Model a single operation within a System over time•Identify the objects involved with each scenario•Identify the passed messages and actions that occur during a scenario•Identify the required response of each actionExample Sequence Diagram:ClassAInstance :ClassBInstancemessage1()message2()message1()Example SequenceDiagram: make Payment:Register :Sale:Paymentan activation box showing the focus of controlmakePayment(cashTendered:<unspecified>)create(cashTendered:<unspecified>)makePayment(cashTendered:<unspecified>)XBasic Sequence Diagram Notation•Links - Sequence Diagrams do not show links•Message - represented with a message expression on an arrowed line between objectsBasic Sequence Diagram Notation (2)•Object Lifeline - the vertical dashed line underneath an object–Objects do not have a lifeline until they are created–The end of an object’s life is marked with an “X” at the end of the lifeline–Passage of time is from top to bottom of diagramBasic Sequence Diagram Notation (3)•Activation - the period of time an object is handling a message (box along lifeline)–Activation boxes can be overlaid to depict an object invoking another method on itselfBasic Sequence Diagram Notation (4)•Conditional Message–[ variable = value ] message()–Message is sent only if clause evaluates to true•Iteration (Looping)–* [ i := 1..N ]: message()–“*” is required; [ ... ] clause is optionalSequence Diagram from AgileModeling.comSequence Diagramming with Ideogramic Modeling ToolSequence Diagram for Java Remote Method Invocationhttp://nathanbalon.net/projects/cis578/cis578_middleware_report.pdfInteraction Diagram Strengths•Communication Diagram–Space Economical - flexibility to add new objects in two dimensions–Better to illustrate complex branching, iteration, and concurrent behavior•Sequence Diagram–Clearly shows sequence or time ordering of messages–Simple notationInteraction Diagram Weaknesses•Communication


View Full Document

NJIT CS 602 - Interaction Diagram Notation

Download Interaction Diagram Notation
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Interaction Diagram Notation and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Interaction Diagram Notation 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?