280 likes | 550 Views
Software Specification KXA233 Lecture 10 Object-Oriented Design Chapter 21. Paul Crowther School of Computing University of Tasmania. Today. Object Oriented Design Subsystem considerations. Responsibility design. Message design. Class and Object Design. Subsystem design.
E N D
Software SpecificationKXA233Lecture 10Object-Oriented DesignChapter 21 Paul Crowther School of Computing University of Tasmania
Today... • Object Oriented Design • Subsystem considerations
Responsibility design Message design Class and Object Design Subsystem design Design for Object oriented Systems • Subsystem layer • Class and object layer • Message layer • Responsibility layer
Operations Attributes Object- Relationship Model Collaborators CRC Index Cards Responsibility design Use Cases Message design Object- Behaviour Model Class and Object Design Subsystem design OOA to OOD
Conventional v OO Approaches • Representation of hierarchy of modules • Specification of data definitions • Specification of procedural logic • Indication of end - end processing sequences • Representation of object states and transitions • Definitions of classes and hierarchies • Assignment of operations to classes • Detailed definition of operations • Specification of message connections • Identification of exclusive services
Design Issues • Decomposability • break a problem into smaller problems • Composability • program components can be reused • Understandability • Continuity • Protection
Design Issues - Design Principles • Linguistic modular units • Few interfaces • Small interfaces(weak coupling) • Explicit interfaces • Information hiding
OOD Landscape - Booch • Architectural Planning • Tactical design • Release Planning
OOD Landscape - Coad- Yourdon • Problem domain component • Human interaction component • Task management component • Data management component
Coad- Yourdon Problem Domain Component • Group all domain specific classes • Design an appropriate class hierarchy • Work to simplify inheritance where appropriate • Refine design to improve performance • Develop an interface with data management component • Refine and add low-level objects as required
Coad- Yourdon Human Interaction Component • Define human actors • Develop task scenarios • Design hierarchy of user commands • Refine the user interaction sequence • Design relevant classes and class hierarchy • Integrate GUI classes as appropriate
Coad- Yourdon Task Management Component • Identify types of tasks (event / time driven) • Establish priorities • Identify coordinator tasks (of other tasks) • Design appropriate objects for each task
Coad- Yourdon Data Management Component • Design the data structures and layout • Design the services required to manage the data structures • Identify tools to assist in implementing data management • design appropriate classes and class hierachy
OOD Landscape - Jacobson • Consider adaptions to make the analysis model fit the real world environment • Create blocks (aggregated objects) as the primary design object • Define a block to implement related analysis objects • Identify interface, entity and control blocks • describe block communication during execution • Identify stimuli between blocks and their order • Create an interaction diagram • Organise blocks into subsystems
OOD Landscape - Rambaugh • Perform system design • Conduct object design • Implement control mechanisms • Adjust class structure to strengthen inheritance • Design messaging to implement object relationships • Package classes into modules
Generic Components of OOD • Describe each of the subsystems in a manner that is implementable • allocate subsystems to tasks • choose a design strategy • design controls • Object design • design operations at the procedural level • define any internal classes • design internal data structures for class attributes • Message design • Review and redesign as appropriate
Partition the Analysis Model • Subsystem should have a well defined interface • Classes within a subsystem should collaborate only with other subclasses in the subsystem • Exception is a small number of communication classes • The number of subsystems should be kept small • Internally partition subsystems to reduce complexity • Communication between subsystems should be client/server or peer-to-peer
Concurrency and Subsystem Allocation • Can more than one object be active at one time? • If so concurrent processing is possible • Thread of control - where one object sends a message to another, then waits for a response. • Tasks are designed by isolating threads of control
Task Management • Strategy for managing concurrent tasks • Characteristics of the task are determined • The coordinator task and associated objects are defined • The coordinator and other tasks are integrated • Tasks • event driven • time driven
Task Management Template • Task name • Description • Priority • Services • Coordinated by • Communicates via • Incorporate into the design model for task objects
Data Management • Management of data critical to the object • Creation of infrastructure for storage and retrieval of objects • Isolate • lower level requirements for manipulating data structures • higher level requirements for handling system attributes • DBMS often used as common data store - objects to manipulate • members of reusable classes identified during analysis • classes supplied by the DBMS vendor
Data Management • Design includes design of attributes and operations to manage objects • Append to every object information about: • How do I store myself? • Create an object-server class (Coad & Yourdon) with services to: • tell each object to save itself • retrieve stored objects for use by other components
Human-Computer Interface GUI • Use-cases • usage scenarios • actors • Serve as input to HCI design process • Once an actor an usage scenario defined: • command hierarchy identified • this defines the major system menu categories (toolbar) • subfunctions (menu windows)
Inter-Subsystem Communication • Use object to object collaboration model • peer-to-peer • client/server • List each request that can be made by collaborators of the subsystem and organise them by subsystem • Define the model type • Note the operations required to implement the responsibilities of the model type
Inter-Subsystem Communication • Note for each case: • Type of model • (client/server or peer-to-peer) • Collaborators • which subsystem(s) • Class • names of classes required to support services • Operation • names of operations required to support services • Message format • Draw a subsystem collaboration graph
Object Design Process • Object description • protocol description • implementation description • Algorithms and data structures • Program Components and Interfaces • All this needs to be part of the Object Specification
Next week... • OO specification details • OO testing