This document discusses object-oriented design and compares it to action-oriented design. It notes that object-oriented design revolves around data decomposition rather than functional decomposition. This leads to decentralized control and better ability to handle complexity. Object-oriented design groups data and related functions together in classes, making maintenance easier when changes are required. Tight coupling and high cohesion are design goals, with common data areas separated into their own classes to be accessed through interfaces.
2. ï‚–
ï‚™ Many different notations are used for documenting
the object oriented design. Most popular of these
include, Rumbaugh, Booch, and Coad, and
UML(Unified Modeling Language). We will be using
UML to document our design. Although the notation
is very comprehensive and detailed, but the key
features of this notation are presented in the
following diagram.
The Notation
4. ï‚–
ï‚™ In the case of action-oriented approach, data is decomposed
according to functionality requirements. That is, decomposition
revolves around function. In the OO approach, decomposition
of a problem revolves around data. Action-oriented paradigm
focuses only on the functionality of a system and typically
ignores the data until it is required. Object- oriented paradigm
focuses both on the functionality and the data at the same time.
The basic difference between these two is decentralized control
mechanism versus centralized control mechanism respectively.
Decentralization gives OO the ability to handle essential
complexity better than action-oriented approach.
ï‚™ This difference is elaborated with the help of the following
diagram:
Object vs Action Oriented
6. ï‚–
ï‚™ In this diagram, the ovals depict the function while rectangles/squares
depict data. Since a function contains dynamic information while data
contains only static information, if the function and data are managed
separately, the required data components can be found by scanning a
function but the functions that use a particular data cannot be found by just
looking at the data. That is, the function knows about the data it needs to
use but the data do not know about the functions using it. That means, it is
easy to make a change in a function since we would know which data
components would be affected by this change. On the other hand,
changing a data structure would be difficult because it would not be easy
to find all the functions that are using this data and hence also need to be
modified.
ï‚™ In the case of OO design since data and function are put together in one
class, hence, in case of a change, the effected components can be identified
easily and the effect of change is localized. Therefore, maintenance
becomes relatively easy as compared to function-oriented approach.
Object vs Action Oriented
8. ï‚–
Let us assume that the circles represent sets of functions
and rectangles represent data that these function use to
carry out their operation. In the object-oriented design,
the data areas that are common among different sets of
functions would be spun-off into their own classes and
the user function would use these data through their
interfaces only. This is shown in the following diagram.
Coupling and Cohesion