Presentation is loading. Please wait.

Presentation is loading. Please wait.

SWT - Diagrammatics Lecture 4/4 - Diagramming in OO Software Development - partB 4-May-2000.

Similar presentations


Presentation on theme: "SWT - Diagrammatics Lecture 4/4 - Diagramming in OO Software Development - partB 4-May-2000."— Presentation transcript:

1 SWT - Diagrammatics Lecture 4/4 - Diagramming in OO Software Development - partB 4-May-2000

2 Previous Lecture Review –OO Introduction, –OO Design Notations, Booch-OMT-UML –Objects, Messages / Control & Data Flow, Classes. –Class Attributes and Operations, –Visibility of Attributes and Operations, –Relationships : –Association, Multiplicity, Aggregation, –Dependency, Inheritance. –Object Oriented Views

3 Overview –Introduction to UML –Goals, History - Timeline, External influences –The 9 types of UML diagrams : –Use Case, Class, Object, Sequence, Collaboration, –Statechart, Activity, Component, Deployment –Flow of data between views –UML references

4 UML Unified Modelling Language UML –Comprehensive syntax –Language, Process and Tool independent. Four goals : –To represent complete systems –To establish explicit coupling between concepts and executable code –To take into account scaling factors –To allow use by both humans and computers

5 UML Timeline Various OO Methodologies Booch’91 OMT-1 OOSE OMT-2 Booch’93 Unified Method 0.8 Unified Method 0.9 UML 1.0 UML1.1 UML Partners 19951996 Jan 1997 Sep 1997

6 External Influences OriginElement BoochCategories / Subsystems EmbleySingleton classes / Composite objects GOFFrameworks / Patterns HarelStatecharts JacobsonUse Cases MeyerPre/Post conditions OdellDynamic classification / Events OMTAssociations Shlaer-MellorObject Lifecycles Wrifs-BrockResponsibilities / Collaborations

7 UML diagram types User Requirements 1.Use Case: system functions from a user’s perspective Static Structure 2.Class: objects and their relationships 3.Object: classes and their relationships Interaction 4.Sequence: dynamic object interaction 5.Collaboration : object and their links/interactions 6.Statechart: behaviour of a class that has states 7.Activity: operation behaviour (as a set of actions) Implementation 8.Component: software components 9.Deployment: software on particular hardware platforms

8 1. Use case diagrams Use case diagrams : –Describe the behaviour of a system from a user’s perspective. –Depict relationships between the system and its environment. –Allow the definition of the systems’ boundaries. A use case diagram can be seen as an instance of interaction between “actors” and the system. Use case User Programmer Architect Tester Analyst expresses implements designs verifies understands

9 Use Case diagrams May contain any of the following relationships : –Communicates : –Uses : –Extends : > Use Case B Use Case AUse Case B Use Case AUse Case B triggers >

10 A Use Case Diagram example

11 2. Class Diagrams Class name + Public Operation( ) # Protected Operation( ) - Private Operation( ) + Public Attribute # Protected Attribute - Private Attribute Class name Association Multiplicity : 1,0..1,*,M..N, N, M..* Class name Aggregation Class name Dependency Abstract Class Name Inheritance

12

13

14 3. Object Diagrams An object/instance diagram represents a concrete situation at a given time. It expresses both the static structure -found in class diagrams- and behaviour. Object diagrams contains objects connected by links. Object Diagrams are mainly used to show a context of interaction or to facilitate the understanding of a complex data structure.

15 An Object Diagram example myCar : Car myEngine : Engine w1 : Wheel w2 : Wheel w3 : Wheel w4 : Wheel = Car Wheel Engine 1 4 1 1 Composition with : Or containment : myCar : Car myEngine : Engine

16 4. Sequence Diagrams Sequence diagrams focus on displaying the interaction between objects, without representing explicitly the context of interaction and the object’s state. Depicting the chronology of the message broadcast, they are useful in all stages of OO modelling. : Caller: Phone : Recipient picks up dial tone dial ring picks up says hello...

17 A Sequence Diagram example

18 5. Collaboration Diagrams Collaboration Diagrams express both the context of a group of objects and the interaction between these objects. Can be considered to be an extension of Object diagrams, adding notation to represent object interaction. Messages are depicted using lines decorated with an arrow that points towards the recipient. To indicate the sending order, messages are explicitly numbered.

19 A Collaboration Diagram example myOrder: Order myitem: Item stocktem: Item op: OrderProperties 1 : Enter item description 2 : get details 3 : *get 4 : getProperties

20 6. Statechart Diagrams A state machine can be used to describe formally the behaviour of objects in terms of states and events. Statecharts represent with : –states : the state of an object –transitions : the passing from one state to another –events : the occurrence of a given situation –guards : conditions for the triggering of events –actions and activities : operations of an object initial intermediate final event event [cond]

21 Two StateChart diagrams URL delay byte read wait for length read data prefix read length read byte read [Count<Length] Suffix read [Count==Length] washing rinsing drying Opened door opened door closed door H

22 7. Activity Diagrams Activity diagrams are : –a variant of statechart diagrams, organised according to actions. –targeted towards representing the internal behaviour of a method, a mechanism or a use case. An activity is represented by a round rectangle : Decisions are represented using a diamond : Synchronisation bars are used for synchronisation Swimlanes are used to split the activity diagram in regions.

23 An Activity Diagram example Get temperature Heat up Cool down [ too cold ] [ too hot ] Switch off heating Open windows

24 8. Component Diagrams Component diagrams depict software components and their relationships within the implementation environment. Components can be all kind of software elements : files, libraries, databases etc. Components contain two parts : A dependency relationship between components usually represent compilation dependencies. Components may contain processes using containment and can be grouped in subsystem components. Body Specification B A

25 A Component Diagram example UI Data Processor Data Manager Database External System Order Processing System

26 9. Deployment Diagrams Deployment diagrams are used to illustrate the physical layout of the various hardware components that are needed for a system to operate. Hardware resources are represented by a cube : Lines annotated with multiplicity information are used to connect cubes. DB Server A B 0..1

27 A Deployment Diagram example CMclientJFC CMclientAWT CMclientCMD Naming Server CMServers CMServers

28 Flow of data between views Classes & Attributes events Interaction Model Use Case Model State Model Object Model classes operations classes operationsstates interactions Business Model -> Logical Model -> Component Model -> Deployment Model

29 UML references UML at rational : http://www.rational.com/uml/ List of tools supporting UML diagrams : http://plg.uwaterloo.ca/~migod/uml.html Cetus page on UML : http://www.cetus-links.org/oo_uml.html

30 The end of diagrammatics course


Download ppt "SWT - Diagrammatics Lecture 4/4 - Diagramming in OO Software Development - partB 4-May-2000."

Similar presentations


Ads by Google