Presentation is loading. Please wait.

Presentation is loading. Please wait.

 2000 Deitel & Associates, Inc. All rights reserved. Optional Case Study - Chapter 5 Outline 5.1 Introduction 5.2 Collaborations 5.3 Creating Collaborations.

Similar presentations


Presentation on theme: " 2000 Deitel & Associates, Inc. All rights reserved. Optional Case Study - Chapter 5 Outline 5.1 Introduction 5.2 Collaborations 5.3 Creating Collaborations."— Presentation transcript:

1  2000 Deitel & Associates, Inc. All rights reserved. Optional Case Study - Chapter 5 Outline 5.1 Introduction 5.2 Collaborations 5.3 Creating Collaborations 5.4 Collaboration Diagrams 5.5 Summary

2  2000 Deitel & Associates, Inc. All rights reserved. 5.1 Introduction This chapter –Last OOD assignment before we begin study of OOP in Chapter 6 –Focus on object collaboration End of section –List of Internet and WWW UML resources (look in text) –Bibliography of UML resources (look in text) Chapter 6 –Begin coding simulator Chapters 7, 9 –Required to complete simulator

3  2000 Deitel & Associates, Inc. All rights reserved. 5.2 Collaborations Collaboration - interaction between objects 1. Object of one class 2. Sends message 3. Received by object of another class –Message invokes operation of second class –In Chapter 4, we determined many operations Now, we focus on the messages that invoke them Next slide –List of verb phrases that correspond to operations Some phrases removed from complete list of all verbs –Remaining phrases are collaborations

4  2000 Deitel & Associates, Inc. All rights reserved. 5.2 Collaborations (II)

5  2000 Deitel & Associates, Inc. All rights reserved. 5.3 Creating Collaborations Creating Collaborations –Examine list of verbs –"resets elevator button" in class Elevator –To do this: Elevator object sends resetButton message to ElevatorButton object This invokes resetButton operation Next slide –List of all collaborations that can be taken from our table of verb phrases

6  2000 Deitel & Associates, Inc. All rights reserved. 5.3 Creating Collaborations (II)

7  2000 Deitel & Associates, Inc. All rights reserved. 5.4 Collaboration Diagrams Collaboration diagrams –Model interaction of objects –Focus on which objects participate in interactions –Sequence diagrams focus on when interactions occur Format –Rectangle - represents object, has name inside –Solid lines - connect collaborating objects Message passed along direction shown by arrows Name of message by arrow –Sequence of messages - numerical ordering of messages

8  2000 Deitel & Associates, Inc. All rights reserved. 5.4 Collaboration Diagrams : FloorButton : Floor passenger : Person 3.1: resetButton( )3.2: turnOn( ) 3: elevatorArrived( ) 4.1.1: passengerExits( )4.2.1: passengerEnters( ) 1: resetButton( )2: ringBell( ) 4: openDoor( ) 4.1: exitElevator( )4.2: enterElevator( ) : Light : Elevator waitingPassenger : Person : Bell : ElevatorButton : Door 1: Elevator resets button 2: Elevator rings bell 3: Elevator notifies floor of arrival 3.1: Floor resets its button 3.2: Floor turns on its light 4: Elevator opens door 4.1: Door sends exitElevator message to passenger 4.1.1 passengerExits 4.2: Door sends enterElevator message to waitingperson 4.2.1 passengerEnters (This sequence ensures that a person exits before another enters)

9  2000 Deitel & Associates, Inc. All rights reserved. 5.5 Summary Reasonably complete listing of classes –Chapter 6 - implement large portion of simulator –Chapter 7 - implement complete, working simulator –Chapter 9 - discuss inheritance Summary of object-oriented design process 0. Analysis phase - meet with clients, gather information Create use cases to describe how users interact with system In this example, began with problem statement (no analysis phase) 1. Classes - locate classes by listing nouns in problem statement Eliminate nouns that are attributes of classes, and nouns that are not part of the system Create a diagram that models classes and associations

10  2000 Deitel & Associates, Inc. All rights reserved. 5.5 Summary Summary of OOD process (continued) 2. Attributes - extract attributes by listing words that describe classes 3. Dynamic Nature - create statechart diagrams to learn how classes change over time 4. Operations - examine verbs associated with each class Extract operations Use activity diagrams to model details of operations 5. Collaborations - examine interactions between objects Use sequence and collaboration diagrams Add attributes and operations as needed Design –We are probably missing a few pieces –This will become apparent as we implement the simulator in Chapter 6


Download ppt " 2000 Deitel & Associates, Inc. All rights reserved. Optional Case Study - Chapter 5 Outline 5.1 Introduction 5.2 Collaborations 5.3 Creating Collaborations."

Similar presentations


Ads by Google