OBJECT-ORIENTED CONCEPTS Any discussion of object-oriented software engineering must begin by addressing the
20.2 OBJECT-ORIENTED CONCEPTS Any discussion of object-oriented software engineering must begin by addressing the
term object-oriented. What is an object-oriented viewpoint? Why is a method con- “Object-oriented
sidered to be object-oriented? What is an object? Over the years, there have been programming is not
many different opinions (e.g., [BER93], [TAY90], [STR88], [BOO86]) about the correct so much a coding
answers to these questions. In the discussion that follows, we attempt to synthesize technique as it is a
the most common of these. code packaging
technique, a way for To understand the object-oriented point of view, consider an example of a real code suppliers to
world object—the thing you are sitting in right now—a chair. Chair is a member (the encapsulate
term instance is also used) of a much larger class of objects that we call furniture. A functionality for
set of generic attributes can be associated with every object in the class furniture. delivery to
customers.” For example, all furniture has a cost, dimensions, weight, location, and color, among
Brad Cox
many possible attributes. These apply whether we are talking about a table or a chair,
a sofa or an armoire. Because chair is a member of furniture, chair inherits all attrib- utes defined for the class. This concept is illustrated schematically in Figure 20.2.
Class: furniture Cost
The object inherits
Dimensions
all attributes of the class
Weight Location Color
Object: chair Cost
Dimensions Weight Location Color
F I G U R E 20.2
Inheritance from class to object
CHAPTER 20
OBJECT-ORIENTED CONCEPTS AND PRINCIPLES
Once the class has been defined, the attributes can be reused when new instances of the class are created. For example, assume that we were to define a new object called a chable (a cross between a chair and a table) that is a member of the class furniture. Chable inherits all of the attributes of furniture.
We have attempted an anecdotal definition of a class by describing its attributes, but something is missing. Every object in the class furniture can be manipulated in
a variety of ways. It can be bought and sold, physically modified (e.g., you can saw Data modeling notation
XRef
can be used to off a leg or paint the object purple) or moved from one place to another. Each of these represent objects and
operations (other terms are services or methods) will modify one or more attributes of their attributes. See
the object. For example, if the attribute location is a composite data item defined as Chapter 12 for details.
location = building + floor + room then an operation named move would modify one or more of the data items (building,
floor, or room) that form the attribute location. To do this, move must have "knowledge" of these data items. The operation move could be used for a chair or a table, as long as both are instances of the class furniture. All valid operations (e.g., buy, sell, weigh) for the class furniture are "connected" to the object definition as shown in Figure
20.3 and are inherited by all instances of the class.
Class: furniture Cost
Dimensions
The object inherits
Weight
all attributes and
Location
operations of the class
Color Buy
Sell Weigh Move
Object: chair Cost
Dimensions
Object: chable
Weight Location
Cost
Color
Dimensions Weight Location
Buy
Color
Sell Weigh Move
F I G U R E 20.3
Buy
Sell
Inheritance of
from class to
object
The object chair (and all objects in general) encapsulates data (the attribute val- ues that define the chair), operations (the actions that are applied to change the attrib- “Encapsulation
utes of chair), other objects (composite objects can be defined [EVB89]), constants prevents a program
(set values), and other related information. Encapsulation means that all of this infor- from becoming so
interdependent that mation is packaged under one name and can be reused as one specification or pro-
a small change has gram component. massive ripple
Now that we have introduced a few basic concepts, a more formal definition of effects.”
object-oriented will prove more meaningful. Coad and Yourdon [COA91] define the
Jim Rumbaugh
term this way:
et al.
object-oriented = objects + classification + inheritance + communication Three of these concepts have already been introduced. We postpone a discussion of
communication until later.
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