Designing Algorithms and Data Structures
22.3.2 Designing Algorithms and Data Structures
A variety of representations contained in the analysis model and the system design pro- vide a specification for all operations and attributes. Algorithms and data structures are
designed using an approach that differs little from the data design and component-level Virtually every concept
XRef
presented in Chapter 13
design approaches discussed for conventional software engineering.
is applicable here. Be An algorithm is created to implement the specification for each operation. In many sure you’re familiar
cases, the algorithm is a simple computational or procedural sequence that can be with the topics
presented there. implemented as a self-contained software module. However, if the specification of the operation is complex, it may be necessary to modularize the operation. Conven- tional component-level design techniques can be used to accomplish this.
Data structures are designed concurrently with algorithms. Since operations invari- ably manipulate the attributes of a class, the design of the data structures that best reflect the attributes will have a strong bearing on the algorithmic design of the cor- responding operations.
? Although many different types of operations exist, they can generally be divided
Is there a
way to
into three broad categories: (1) operations that manipulate data in some way (e.g.,
categorize operations adding, deleting, reformatting, selecting), (2) operations that perform a computa-
(methods)?
tion, and (3) operations that monitor an object for the occurrence of a controlling event.
For example, the SafeHome processing narrative contains the sentence fragments: "sensor is assigned a number and type" and "a master password is programmed for arming and disarming the system." These two phrases indicate a number of things:
• That an assign operation is relevant for the sensor object. • That a program operation will be applied to the system object. • That arm and disarm are operations that apply to system (also that system
status may ultimately be defined (using data dictionary notation) as
system status = [armed | disarmed] The operation program is allocated during OOA, but during object design it will be
An operation is refined refined into a number of more specific operations that are required to configure the in much the same way system. For example, after discussions with product engineering, the analyst, and that we refine a
possibly the marketing department, the designer might elaborate the original pro- function in
cessing narrative and write the following for program (potential operations—verbs— conventional design.
Write a processing are underlined): narrative, do a
Program enables the SafeHome user to configure the system once it has been installed. The
grammatical parse, and isolate new user can (1) install phone numbers; (2) define delay times for alarms; (3) build a sensor table
operations at a lower
that contains each sensor ID, its type, and location; and (4) load a master password.
level of abstraction. Therefore, the designer has refined the single operation program and replaced it with the operations: install, define, build, and load. Each of these new operations becomes part of the system object, has knowledge of the internal data structures that implement the object's attributes, and is invoked by sending the object messages of the form
MESSAGE (system) --> install: SENDS telephone.number; This implies that, to provide the system with an emergency phone number, an install
message will be sent to system. Verbs connote actions or occurrences. In the context of object design formaliza- tion, we consider not only verbs but also descriptive verb phrases and predicates (e.g., "is equal to") as potential operations. The grammatical parse is applied recur- sively until each operation has been refined to its most-detailed level.
CHAPTER 22 OBJECT-ORIENTED DESIGN
Once the basic object model is created, optimization should occur. Rumbaugh and his colleagues [RUM91] suggest three major thrusts for OOD design optimization:
• Review the object-relationship model to ensure that the implemented design leads to efficient utilization of resources and ease of implementation. Add redundancy where necessary.
• Revise attribute data structures and corresponding operation algorithms to
enhance efficient processing. • Create new attributes to save derived information, thereby avoiding recom-
putation.
A detailed discussion of OO design optimization is beyond the scope of this book. The interested reader should refer to [RUM91] and [CHA93]. For a discussion of how these concepts translate into the UML process, the reader should examine [JAC99] and [RUM99].
Parts
» The Concurrent Development Model
» SUMMARY Software engineering is a discipline that integrates process, methods, and tools for
» PEOPLE In a study published by the IEEE [CUR88], the engineering vice presidents of three
» THE PROCESS The generic phases that characterize the software process—definition, development,
» THE PROJECT In order to manage a successful software project, we must understand what can go
» METRICS IN THE PROCESS AND PROJECT DOMAINS
» Extended Function Point Metrics
» METRICS FOR SOFTWARE QUALITY
» INTEGRATING METRICS WITHIN THE SOFTWARE PROCESS
» METRICS FOR SMALL ORGANIZATIONS
» ESTABLISHING A SOFTWARE METRICS PROGRAM
» Obtaining Information Necessary for Scope
» An Example of LOC-Based Estimation
» QUALITY CONCEPTS 1 It has been said that no two snowflakes are alike. Certainly when we watch snow
» SUMMARY Software quality assurance is an umbrella activity that is applied at each step in the
» R diagram 1.4 <part-of> data model; data model <part-of> design specification;
» SYSTEM MODELING Every computer-based system can be modeled as an information transform using an
» Facilitated Application Specification Techniques
» Data Objects, Attributes, and Relationships
» Entity/Relationship Diagrams
» Hatley and Pirbhai Extensions
» Creating an Entity/Relationship Diagram
» SUMMARY Design is the technical kernel of software engineering. During design, progressive
» Data Modeling, Data Structures, Databases, and the Data Warehouse
» Data Design at the Component Level
» A Brief Taxonomy of Styles and Patterns
» Quantitative Guidance for Architectural Design
» Isolate the transform center by specifying incoming and outgoing
» SUMMARY Software architecture provides a holistic view of the system to be built. It depicts the
» The User Interface Design Process
» Defining Interface Objects and Actions
» D E S I G N E VA L U AT I O N
» Testing for Real-Time Systems
» Organizing for Software Testing
» Criteria for Completion of Testing
» The Transition to a Quantitative View
» The Attributes of Effective Software Metrics
» Architectural Design Metrics
» Component-Level Design Metrics
» SUMMARY Software metrics provide a quantitative way to assess the quality of internal product
» Encapsulation, Inheritance, and Polymorphism
» Identifying Classes and Objects
» The Common Process Framework for OO
» OO Project Metrics and Estimation
» Event Identification with Use-Cases
» SUMMARY Object-oriented analysis methods enable a software engineer to model a problem by
» Partitioning the Analysis Model
» Designing Algorithms and Data Structures
» Program Components and Interfaces
» SUMMARY Object-oriented design translates the OOA model of the real world into an
» Testing Surface Structure and Deep Structure
» Deficiencies of Less Formal Approaches 1
» What Makes Cleanroom Different?
» Design Refinement and Verification
» SUMMARY Cleanroom software engineering is a formal approach to software development that
» Structural Modeling and Structure Points
» Describing Reusable Components
» SUMMARY Component-based software engineering offers inherent benefits in software quality,
» Guidelines for Distributing Application Subsystems
» Middleware and Object Request Broker Architectures
» An Overview of a Design Approach
» Consider expert Web developer will create a complete design, but time and cost can be appropriate
» A Software Reengineering Process Model
» Reverse Engineering to Understand Data
» Forward Engineering for Client/Server Architectures
» SUMMARY Reengineering occurs at two different levels of abstraction. At the business level,
Show more