1 CS 501 Spring 2003 CS 501: Software Engineering Lecture 18 Object Oriented Design II.

Slides:



Advertisements
Similar presentations
® IBM Software Group © 2006 IBM Corporation Rational Software France Object-Oriented Analysis and Design with UML2 and Rational Software Modeler 04. Other.
Advertisements

Use Case Diagram © copyright 2001 SNU OOPSLA Lab..
Object-Oriented Analysis and Design
L4-1-S1 UML Overview © M.E. Fayad SJSU -- CmpE Software Architectures Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I.
CS CS 5150 Software Engineering Lecture 15 Object Oriented Design 1.
1 CS 501 Spring 2007 CS 501: Software Engineering Lecture 16 Object Oriented Design 2.
1 CS 501 Spring 2005 CS 501: Software Engineering Lecture 8 Requirements II.
1 CS 501 Spring 2008 CS 501: Software Engineering Lecture 16 Object Oriented Design 2.
CS 501: Software Engineering Fall 2000 Lecture 11 Object-Oriented Design I.
CS CS 5150 Software Engineering Lecture 15 Object Oriented Design 1.
CS CS 5150 Software Engineering Lecture 13 System Architecture and Design 1.
CS CS 5150 Software Engineering Lecture 13 System Architecture and Design 1.
Software Engineering Lecture 9 Object-Oriented Design II.
C++ Training Datascope Lawrence D’Antonio Lecture 11 UML.
1 CS 501 Spring 2008 CS 501: Software Engineering Lectures 15 Object Oriented Design 1.
UML Sequence Diagrams Eileen Kraemer CSE 335 Michigan State University.
CS 501: Software Engineering Fall 2000 Lecture 13 Object-Oriented Design III.
CS 501: Software Engineering Fall 2000 Lecture 12 Object-Oriented Design II.
1 CS 501 Spring 2005 CS 501: Software Engineering Lecture 16 Object Oriented Design 2.
CS CS 5150 Software Engineering Lecture 16 Object Oriented Design 2.
SE-565 Software System Requirements More UML Diagrams.
1 CS 501 Spring 2002 CS 501: Software Engineering Lecture 16 Object Oriented Design I.
UML Sequence Diagrams Michael L. Collard, Ph.D. Department of Computer Science Kent State University.
Basic Concepts The Unified Modeling Language (UML) SYSC System Analysis and Design.
CS CS 5150 Software Engineering Lecture 18 Program Design 3.
SOFTWARE ENGINEERING BIT-8 APRIL, 16,2008 Introduction to UML.
Changing Perspective From Structured to Object-oriented.
1 Object-Oriented Modeling Using UML (2) CS 3331 Fall 2009.
CS 501: Software Engineering Fall 1999 Lecture 18 (a) Project Reports (b) Object-Oriented Design III.
CS CS 5150 Software Engineering Lecture 17 Object Oriented Design 3.
1 CS 501 Spring 2006 CS 501: Software Engineering Lecture 17 Object Oriented Design 3.
For accurate communication, since a project can have several participants, each from different background. Represent a given aspect of the system We will.
CS CS 5150 Software Engineering Lecture 13 System Architecture and Design 1.
CS CS 5150 Software Engineering Lecture 15 Program Design 1.
Software Engineering Prof. Ing. Ivo Vondrak, CSc. Dept. of Computer Science Technical University of Ostrava
UML diagrams What is UML UML diagrams –Static modeoing –Dynamic modeling 1.
ניתוח מערכות מידע 1 Unified Modeling Language (UML) § § The Unified Modeling Language (UML) is the industry-standard language for: Specifying, Visualizing,
Software Engineering Lecture 10 UML vs. ERD.
L6-S1 UML Overview 2003 SJSU -- CmpE Advanced Object-Oriented Analysis & Design Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I College.
TAL7011 – Lecture 4 UML for Architecture Modeling.
The Unified Modeling Language Part II Omar Meqdadi SE 2730 Lecture 9 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
Discovering object interaction. Use case realisation The USE CASE diagram presents an outside view of the system. The functionality of the use case is.
Course Instructor: Kashif Ihsan 1. Chapter # 3 2.
CS CS 5150 Software Engineering Lecture 13 System Architecture and Design 1.
Logical view –show classes and objects Process view –models the executables Implementation view –Files, configuration and versions Deployment view –Physical.
Software Engineering Lecture 8 Object-Oriented Analysis.
OMT Modeling 1. Object Model : presented by the object model and the data dictionary. 2. Dynamic Model: presented by the state diagrams and event flow.
 Building Block Building Block  Things in the UML Things in the UML  Structural Things Structural Things  Behavioral Things Behavioral Things  Grouping.
Week 04 Object Oriented Analysis and Designing. What is a model? A model is quicker and easier to build A model can be used in simulations, to learn more.
1 CS 501 Spring 2002 CS 501: Software Engineering Lecture 17 Object Oriented Design II.
Introduction to UML Hazleen Aris Software Eng. Dept., College of IT, UNITEN. …Unified Modeling Language.
CS 501: Software Engineering Fall 1999 Lecture 15 Object-Oriented Design I.
1 CS 501 Spring 2002 CS 501: Software Engineering Lecture 15 System Architecture III.
Analysis Classes Unit 5.
CHAPTER
UML Diagrams By Daniel Damaris Novarianto S..
Course Outcomes of Object Oriented Modeling Design (17630,C604)
Unified Modeling Language
Dynamic Modeling of Banking System Case Study - II
Introduction to Unified Modeling Language (UML)
UML Diagrams Jung Woo.
CS 501: Software Engineering Fall 1999
CS 501: Software Engineering
UML dynamic Modeling (Behavior Diagram)
Unified Modeling Language
CS 501: Software Engineering
IMPORTANT NOTICE TO STUDENTS:
Software Design Lecture : 15.
Sylnovie Merchant, Ph.D. MIS 161 Spring 2005
CS 501: Software Engineering
Presentation transcript:

1 CS 501 Spring 2003 CS 501: Software Engineering Lecture 18 Object Oriented Design II

2 CS 501 Spring 2003 Administration New syllabus Quiz 4 on Thursday, April 3 (no lecture) Lecture 23 on Wednesday April 16 (evening) Second presentation and report next week Sign up. Assignment will be posted shortly Quiz 3 Collect after class No office hours next week

3 CS 501 Spring 2003 Actor and Use Case Diagram An actor is a user of a system in a particular role. An actor can be human or an external system. A use case is a a task that an actor needs to perform with the help of the system. Borrow book BookBorrower

4 CS 501 Spring 2003 Use Cases and Actors A scenario is an instance of a use case Actor is role, not an individual (e.g., librarian can have many roles) Actor must be a "beneficiary" of the use case (e.g., not librarian who processes book when borrowed) In UML, the system boundary is the set of use cases.

5 CS 501 Spring 2003 Use Cases for Borrowing Books Borrow copy of book BookBorrower Return copy of book Reserve book Extend loan

6 CS 501 Spring 2003 Relationships Between Use Cases: > BookBorrower Check for reservation Extend loan > Borrow copy of book

7 CS 501 Spring 2003 Relationships Between Use Cases: > Borrow copy of book BookBorrower Refuse loan >

8 CS 501 Spring 2003 Use Cases in the Development Cycle Use cases are a tool in requirements analysis Intuitive -- easy to discuss with clients Use cases are often hard to translate into class models Scenarios are useful to validate design

9 CS 501 Spring 2003 Modeling Dynamic Aspects of Systems Interaction diagrams: set of objects and their relationships including messages that may be dispatched among them Sequence diagrams: time ordering of messages Collaboration diagrams: structural organization of objects that send and receive messages Activity diagram: flow chart showing flow of control from activity to activity Statechart diagram: models a state machine

10 CS 501 Spring 2003 Notation: States Waiting A state machine is a behavior that specifies the sequence of states an object or an interaction goes through during its lifetime in response to events.

11 CS 501 Spring 2003 State Diagram State diagram for class Book not borrowable returned() borrowable borrowed()[not last copy] borrowed()[last copy] guard expression

12 CS 501 Spring 2003 A Quiz Question A machine tool is controlled by a switch and two buttons: powerTurn the power on/off (switch) startStart the machine (button) stopStop the machine (button) There is also a blade guard. To change the blade, the power must be off and the blade guard removed. To run the machine, press the start button. The power must be turned on and the blade guard must be in place. The machine runs until the stop button is pressed. While the machine is running, the blade guard is locked in place.

13 CS 501 Spring 2003 Power off Guard off run A Quiz Question: States Power off Guard on Power on Guard on Power on Guard off ready safe change danger

14 CS 501 Spring 2003 A Quiz Question: Transitions Transitions power on power off start stop guard on guard off

15 CS 501 Spring 2003 A Quiz Question: State Transition Table power on power off startstop guard on guard off safe change danger ready run dangersafe ready change danger change safe ready safe ready not specified

16 CS 501 Spring 2003 run A Quiz Question: State Transition Diagram ready safe change danger start stop power off guard off guard on power off power on

17 CS 501 Spring 2003 Notation for Classes and Objects Classes Objects AnyClass attribute1 attribute2 operation1() operation2() AnyClass or anObject:AnyClass :AnyClass anObject The names of objects are underlined. or

18 CS 501 Spring 2003 Notation: Active Class EventManager eventlist suspend() flush() An active class is a class whose objects own one or more processes or threads and therefore can initiate control activity.

19 CS 501 Spring 2003 Notation: Interaction display An interaction is a behavior that comprises a set of messages exchanged among a set of objects within a particular context to accomplish a specific purpose.

20 CS 501 Spring 2003 Actions on Objects call return send create destroy returnCopy(c) okToBorrow()local status notifyReturn(b)asynchronous signal > stereotypes

21 CS 501 Spring 2003 Bouncing Ball Diagrams Example: execution of Client Servers domain name service TCP connection HTTP get

22 CS 501 Spring 2003 Sequence Diagram: Borrow Copy of a Book BookBorrower libMem: LibraryMember theCopy:Copy theBook:Book borrow(theCopy) okToBorrow borrow

23 CS 501 Spring 2003 Sequence Diagram: Change in Cornell Program Cornellian :MEngStudent 1 : getName() sequence numbers added to messages :PhDStudent 1.1 : name 2: new PhDStudent(name) 3: >

24 CS 501 Spring 2003 Sequence Diagram: Painting Mechanism :Thread:Toolkit:ComponentPeertarget:HelloWorld run callbackLoop handleExpose paint

25 CS 501 Spring 2003 Other Diagrams in UML Activity diagram is a statechart diagram that shows the flow from activity to activity within a system. Component diagram shows the organization and dependencies among a set of components. Deployment diagram shows the configuration of processing nodes and the components that live on them.

26 CS 501 Spring 2003 Activity Diagram: Process Modeling Release work order Assign tasksReschedule [materials not ready] [materials ready] guard expression branch

27 CS 501 Spring 2003 Activity Diagram: Parallel Activities DecompressStream audioStream video fork join start state stop state

28 CS 501 Spring 2003 Implementation Modeling Subsystem A grouping of elements that specifies what a part of a system should do. Component (UML definition) "A distributable piece of implementation of a system, including software code (source, binary, or executable) but also including business documents, etc., in a human system." A component can be thought of as an implementation of a subsystem.

29 CS 501 Spring 2003 Notation: Collaboration Chain of responsibility A collaboration defines an interaction, i.e., a society of roles and other elements that work together to provide some cooperative behavior.

30 CS 501 Spring 2003 Notation: Component & Node orderform.java A component is a physical and replaceable part of a system that conforms to and provides the realization of a set of interfaces. Server A node is a physical element that exists at run time and represents a computational resource.

31 CS 501 Spring 2003 Component Diagram HelloWorld.class hello.java hello.hml hello.jpg executable component

32 CS 501 Spring 2003 Components and Classes Classes represent logical abstractions. Components represent physical things. Components may live on nodes. Classes have attributes and operations directly. Components have operations that are reachable only through interfaces.

33 CS 501 Spring 2003 Components and Classes agent.dll AgentAction Policy PatternSearch

34 CS 501 Spring 2003 Components and Classes agent.dll Realizes AgentAction PatternSearch Policy extended component

35 CS 501 Spring 2003 Interfaces simulation.exe render.java IRender dependency interface realization

36 CS 501 Spring 2003 Application Programming Interface (API) API is an interface that is realized by one or more components. simulation.exe IModelsILighting IRender

37 CS 501 Spring 2003 Components and Replaceability Components allow system to be assembled from binary replaceable elements. A component is physical -- bits not concepts A component can be replaced by any other component(s) that conforms to the interfaces. A component is part of a system. A component provides the realization of a set of interfaces.

38 CS 501 Spring 2003 An Exam Question: Object Oriented Design A system generates weather maps using data collected from unattended weather stations. Each weather station collects meteorological data and produces summaries of the data. On request, it sends the summary information to an area computer. The area computer uses a database of digitized maps to generate a set of local weather maps.

39 CS 501 Spring 2003 Exam Question: Noun Identification A system generates weather maps using data collected from unattended weather stations. Each weather station collects meteorological data and produces summaries of the data. On request, it sends the summary information to an area computer. The area computer uses a database of digitized maps to generate a set of local weather maps.

40 CS 501 Spring 2003 Exam Question: Candidate Classes Systemgeneral term WeatherMap Datasame as MeteorologicalData WeatherStationis this a general term? MeteorologicalDatahow does this relate to WeatherStation? DataSummaryhow does this relate to MeteorologicalData? AreaComputerhardware Databasegeneral term DigitizedMap

41 CS 501 Spring 2003 Exam Question: Observations about the Candidate Classes WeatherMapis a DigitizedMap is derived from 1...* DataSummary WeatherStationhas a set of MeteorologicalData MeteorologicalData DataSummaryis derived from MeteorologicalData DigitizedMap Can Meteorological Data be an attribute of WeatherStation? Can DataSummary be combined with WeatherMap?

42 CS 501 Spring 2003 Exam Question: Attributes and Operations WeatherStation location metereologicalData collectData() getSummary() WeatherMap location date-time geographicData weather gatherData() printMap() DigitizedMap location geographicData printMap() Or should MetereologicalData be a separate object?

43 CS 501 Spring 2003 Exam Question: Class Diagram DigitizedMap 1...* 1 WeatherStation location metereologicalData collectData() getSummary() WeatherMap location date-time geographicData weather gatherData() printMap() summary