A Student Guide to Object- Oriented Development Chapter 10 Designing objects and classes.
-
Upload
osborn-spencer -
Category
Documents
-
view
213 -
download
0
Transcript of A Student Guide to Object- Oriented Development Chapter 10 Designing objects and classes.
![Page 1: A Student Guide to Object- Oriented Development Chapter 10 Designing objects and classes.](https://reader036.fdocuments.us/reader036/viewer/2022082819/56649f225503460f94c3ac79/html5/thumbnails/1.jpg)
A Student Guide to Object-A Student Guide to Object-Oriented DevelopmentOriented Development
Chapter 10 Designing objects and Chapter 10 Designing objects and classesclasses
![Page 2: A Student Guide to Object- Oriented Development Chapter 10 Designing objects and classes.](https://reader036.fdocuments.us/reader036/viewer/2022082819/56649f225503460f94c3ac79/html5/thumbnails/2.jpg)
Detailed design activitiesDetailed design activities
Revisit class diagram to add implementation details
Revisit interaction diagrams to add implementation detail
![Page 3: A Student Guide to Object- Oriented Development Chapter 10 Designing objects and classes.](https://reader036.fdocuments.us/reader036/viewer/2022082819/56649f225503460f94c3ac79/html5/thumbnails/3.jpg)
Class diagramClass diagram
Add new classes e.g. interface and control classes
Specify technical details of associations between classes
Specify visibility of classes, attributes and operation
Specify attributes in detailSpecify operations in detail
![Page 4: A Student Guide to Object- Oriented Development Chapter 10 Designing objects and classes.](https://reader036.fdocuments.us/reader036/viewer/2022082819/56649f225503460f94c3ac79/html5/thumbnails/4.jpg)
Different types of classesDifferent types of classes
Entity classes
Boundary classes
Control classes
![Page 5: A Student Guide to Object- Oriented Development Chapter 10 Designing objects and classes.](https://reader036.fdocuments.us/reader036/viewer/2022082819/56649f225503460f94c3ac79/html5/thumbnails/5.jpg)
EntityEntity classesclasses
Model features of the problem domain e.g. bikes, customers, hires
Also known as domain or application classes
All of the classes so far have been entity classes
![Page 6: A Student Guide to Object- Oriented Development Chapter 10 Designing objects and classes.](https://reader036.fdocuments.us/reader036/viewer/2022082819/56649f225503460f94c3ac79/html5/thumbnails/6.jpg)
Boundary classesBoundary classes
Model the system’s interface with its actors
Used to capture user input and present results
![Page 7: A Student Guide to Object- Oriented Development Chapter 10 Designing objects and classes.](https://reader036.fdocuments.us/reader036/viewer/2022082819/56649f225503460f94c3ac79/html5/thumbnails/7.jpg)
Control classesControl classes
Control the sequencing of events (e.g. in the execution of a use case scenario)
In a system of any size we expect a boundary and a control object for each use case
![Page 8: A Student Guide to Object- Oriented Development Chapter 10 Designing objects and classes.](https://reader036.fdocuments.us/reader036/viewer/2022082819/56649f225503460f94c3ac79/html5/thumbnails/8.jpg)
Attribute signature: Bike class Attribute signature: Bike class attribute - depositattribute - deposit
#deposit : Integer = 0
visibility name type-expressioninitial-value
![Page 9: A Student Guide to Object- Oriented Development Chapter 10 Designing objects and classes.](https://reader036.fdocuments.us/reader036/viewer/2022082819/56649f225503460f94c3ac79/html5/thumbnails/9.jpg)
+findBike(bike# : Integer) : Bike
visibility name
parameter list Return-type
Operation signature:Bike class - Operation signature:Bike class - findBike(bike)findBike(bike)
![Page 10: A Student Guide to Object- Oriented Development Chapter 10 Designing objects and classes.](https://reader036.fdocuments.us/reader036/viewer/2022082819/56649f225503460f94c3ac79/html5/thumbnails/10.jpg)
Wheels collaboration diagram for use case ‘Maintain Bike’, Wheels collaboration diagram for use case ‘Maintain Bike’, ‘Add new bike’ scenario‘Add new bike’ scenario
Control object :MaintainBike added Interface object :MaintainBikeUI added
![Page 11: A Student Guide to Object- Oriented Development Chapter 10 Designing objects and classes.](https://reader036.fdocuments.us/reader036/viewer/2022082819/56649f225503460f94c3ac79/html5/thumbnails/11.jpg)
Collection class in useCollection class in use : MaintainBike
UI : BikeList : Bike
bikeID:=getBike (bike#)
* bikeID:=findBike(bike#)
getDailyHireRate ( )
Sequence diagram showing how the collection class works
![Page 12: A Student Guide to Object- Oriented Development Chapter 10 Designing objects and classes.](https://reader036.fdocuments.us/reader036/viewer/2022082819/56649f225503460f94c3ac79/html5/thumbnails/12.jpg)
Sequence diagrams: object creation and Sequence diagrams: object creation and deletiondeletion
the interface object :MaintainBikeUI is created and destroyed in this interaction
![Page 13: A Student Guide to Object- Oriented Development Chapter 10 Designing objects and classes.](https://reader036.fdocuments.us/reader036/viewer/2022082819/56649f225503460f94c3ac79/html5/thumbnails/13.jpg)
Sequence diagrams: iterationSequence diagrams: iteration
![Page 14: A Student Guide to Object- Oriented Development Chapter 10 Designing objects and classes.](https://reader036.fdocuments.us/reader036/viewer/2022082819/56649f225503460f94c3ac79/html5/thumbnails/14.jpg)
Sequence diagrams: iterationSequence diagrams: iteration
everything inside the rectangle is repeated while there are more bikes to add
![Page 15: A Student Guide to Object- Oriented Development Chapter 10 Designing objects and classes.](https://reader036.fdocuments.us/reader036/viewer/2022082819/56649f225503460f94c3ac79/html5/thumbnails/15.jpg)
Sequence diagrams: conditional behaviour Sequence diagrams: conditional behaviour and branchingand branching
conditions should be mutually exclusive
![Page 16: A Student Guide to Object- Oriented Development Chapter 10 Designing objects and classes.](https://reader036.fdocuments.us/reader036/viewer/2022082819/56649f225503460f94c3ac79/html5/thumbnails/16.jpg)
Wheels: design sequence diagramWheels: design sequence diagram