180 likes | 210 Views
A Student Guide to Object-Oriented Development. Chapter 10 Designing objects and classes. Detailed design activities. Revisit class diagram to add implementation details Revisit interaction diagrams to add implementation detail. Class diagram.
E N D
A Student Guide to Object-Oriented Development Chapter 10 Designing objects and classes
Detailed design activities • Revisit class diagram to add implementation details • Revisit interaction diagrams to add implementation detail
Class 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 detail • Specify operations in detail
Different types of classes • Entity classes • Boundary classes • Control classes
Entityclasses • 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
Boundary classes • Model the system’s interface with its actors • Used to capture user input and present results
Control 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
visibility name initial-value type-expression Attribute signature: Bike class attribute - deposit #deposit : Integer = 0
visibility name parameter list Return-type Operation signature:Bike class - findBike(bike) +findBike(bike# : Integer) : Bike
Wheels collaboration diagram for use case ‘Maintain Bike’, ‘Add new bike’ scenario • Control object:MaintainBike added • Interface object :MaintainBikeUIadded
Collection class in use • Sequence diagram showing how the collection class works
Sequence diagrams: object creation and deletion the interface object :MaintainBikeUI is created and destroyed in this interaction
Sequence diagrams: iteration everything inside the rectangle is repeated while there are more bikes to add
Sequence diagrams: conditional behaviour and branching conditions should be mutually exclusive