Chapter 22 Object-Oriented Design
Overview
This chapter discusses the steps required to develop an object-oriented
software design from an object-oriented analysis model. Object-oriented design
(OOD) is divided into two major activities: system design and object design.
System design defines the product architecture (the system functions and classes
encapsulated in the subsystems). System design focuses on the specification of
three components: the user interface, data management functions, and task
management facilities. Object design focuses on the internal details of the
individual classes and the messaging scheme. The design specification document
form the SEPA web site is applicable to OOD. The OOD projects must be reviewed
to ensure quality.
Object-Oriented Design Layers
- Responsibilities layer (highest layer - contains data structure detail and
algorithmic detail for each object's attributes and operations)
- Message layer (establishes the internal and external interfaces for the
system, including the details of communication among object collaborators)
- Class and object layer (contains class hierarchy including representations
of each object)
- Subsystem layer (lowest level - contains representations of each of the
subsystems and the necessary infrastructure that enable the software to
achieve the customer's requirements)
Object-oriented Design Issues
- Decomposability - facility of design method that allows the designer to
decompose the problem into easily solved subproblems
- Composability - degree to which design method ensures that modules
constructed for one project can be reused in another
- Understandablity - ease with which a component can be understood without
examining other components
- Continuity - ability to isolate changes made in one module and restrict
the propagation of changes to other modules
- Protection - architectural characteristic that reduces the propagation of
side effects when errors occur
Generic Object-Oriented Design Steps
- Describe each subsystem and allocate it to processors and tasks
- Choose a design strategy for implementing data management, interface
support, and task management
- Design an appropriate system control mechanism
- Perform object design by creating a procedural representation for each
operation and data structures for each attribute
- Perform message design using collaborations between objects and
object-relationships
- Create a messaging model
- Review the design model and iterate as required
Unified Approach to Object-Oriented Design
- System design - UML (unified modeling language) design activity that
focuses on software architecture and definition of subsystems
- Object design - UML design activity that focuses on describing object and
their interactions at a level of detail that will allow them to be implemented
in some programming language
Object-Oriented System Design Process
- Partition the analysis model into subsystems
- subsystems should have well defined communication interfaces
- with few exceptions classes should collaborate within their subsystem
- keep number of subsystems small
- partition subsystem internally to reduce complexity
- Identify concurrency dictated by the problem
- Allocate subsystems to processors and tasks
- allocate each subsystem to an independent processor (or)
- allocate subsystems to same processor and provide concurrency support
through operating system features
- Develop user interface design
- Choose basic strategy for implementing data management
- management of data critical to the application itself
- creation of infrastructure for storage and retrieval of objects
- Identify global resources and control mechanisms to access them
- Design control mechanism for system (including task management)
- Consider how subsystem boundary conditions should be handled
- list each request (contract) that can be made by subsystem collaborators
- for each contract note the operations required to implement the
responsibilities implied by the contract
- for each contract create a table with these entries: type, collaborators,
class, operation, message format
- if subsystem interaction modes are complex create a
subsystem-collaboration diagram
- Review and consider trade-offs
Object Design Process
- protocol description - object interface specified by defining each message
an object can receive and the operation triggered by message (or)
- implementation description - shows implementation details for each
operation implied a message passed to the object
- Designing algorithms and data structures
- algorithm categories: data manipulation, computation, monitors
- refinement of operation programs defined during OOA
- review object-relationship model to ensure implemented design leads to
efficient resource utilization, add redundancy where necessary
- revise attribute data structures and related operation algorithms to
improve processing efficiency
- create attributes to save derived information and avoid
recomputation
- Modularity is important aspect of object-oriented design quality (the
program design language should support object definition)
Design Pattern Specification Components
- Name
- Intent
- Design forces motivating the pattern
- Solution that mitigates these design forces
- Classes required to implement the solution
- Responsibilities and collaborations among the solution classes
- Implementation suggestions
- Source code examples or templates
- Cross-references to related design patterns
Using Design Patterns in Object-Oriented Design
- Inheritance - makes use of an existing design pattern to create a template
for a new subclass
- Composition - assembling complex objects or subsystems out of selected
design patterns using only interface information