Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 2511 Fall 2014. UML Diagram Types  2 Main Types Structure Diagrams ○ Class Diagrams ○ Component Diagrams ○ Object Diagrams Behavior Diagrams ○ Sequence.

Similar presentations


Presentation on theme: "CS 2511 Fall 2014. UML Diagram Types  2 Main Types Structure Diagrams ○ Class Diagrams ○ Component Diagrams ○ Object Diagrams Behavior Diagrams ○ Sequence."— Presentation transcript:

1 CS 2511 Fall 2014

2 UML Diagram Types  2 Main Types Structure Diagrams ○ Class Diagrams ○ Component Diagrams ○ Object Diagrams Behavior Diagrams ○ Sequence Diagrams ○ Use Case Diagrams

3 Sequence Diagrams sequence diagram  A sequence diagram in Unified Modeling Language (UML) is a kind of interaction diagram that shows how processes operate with one another and in what order. objects  In Java most of the interaction between processes is done via objects, and thus a sequence diagram basically shows how objects interact with other objects.

4 Organization Object Name: Class Name :Class NameObject Name Method Call

5 Some Important Points  Each use case can be depicted as a sequence diagram.  An underline with the class name and/or object name usually means that the entity being displayed is an object not a class.

6 Object  Each box represents an Object that is alive (i.e. it’s constructor has been called) at a particular time in the computation.  3 options to represent objects : Object Name: Class Name :Class NameObject Name

7 LifeLines  The time for which an object is “alive” i.e. still in scope (which means has not been garbage collected yet) is represented by a life line. smallCircle :Circle

8 Activation Bars  Activation bars are used to represent the time when an object is calling a method.  The activation bars ends when the method that was called returns. smallCircle :Circle myMonitor: Display methodCall( ) Returned from method

9 Call Arrows and Method Names  A call is represented by an arrow going from one object to another.  Method Names are represented on the call arrow. :BridgeProblem currentState :BridgeState >

10 Examples  Code : public static void main(String[] args) { BridgeState initialState = new BridgeState("west", "west", "west", "west", "west", 0); BridgeState finalState = new BridgeState("east", "east", "east", "east", "east", 17); initialState.display(); finalState.display(); }

11 Sequence Diagram initialState: BridgeState > finalState: BridgeState > display() BridgeTest1. main


Download ppt "CS 2511 Fall 2014. UML Diagram Types  2 Main Types Structure Diagrams ○ Class Diagrams ○ Component Diagrams ○ Object Diagrams Behavior Diagrams ○ Sequence."

Similar presentations


Ads by Google