Elements of
the Object Model
There are five main
kinds of programming styles, listed here with the kinds of abstractions they
employ:
1. Procedure-oriented Algorithms
2. Object-oriented Classes
and objects
3. Logic-oriented Goals,
often expressed in a predicate calculus
4. Rule-oriented If–then
rules
5. Constraint-oriented Invariant relationships
There is no single
programming style that is best for all kinds of applications. For example,
rule-oriented programming would be best suited for the design of a knowledge
base, and procedure-oriented programming would be best for the design of
computation-intense operations.
Each
of these styles of programming is based on its own conceptual framework. Each
requires a different mindset, a different way of thinking about the problem. For
all things object-oriented, the conceptual framework is the object model. There
are four major elements of this model:
1. Abstraction
2. Encapsulation
3. Modularity
4. Hierarchy
There
are three minor elements of the object model:
1.
Typing
2.
Concurrency
3.
Persistence
By minor,
we mean that each of these elements is a useful, but not essential, part of the
object model.
The
Meaning of Abstraction
An
abstraction denotes the essential characteristics of an object that distinguish
it from all other kinds of objects and thus provide crisply defined conceptual boundaries,
relative to the perspective of the viewer.
·
Entity abstraction An object that represents a
useful model of a problem domain or solution domain entity
·
Action abstraction An object that provides a
generalized set of operations, all of which perform the same kind of function
·
Virtual machine abstraction An object that
groups operations that are all used by some superior level of control, or operations
that all use some junior-level set of operations
·
Coincidental abstraction An object that packages
a set of operations that have no relation to each other
Abstraction of a Temperature Sensor

No comments:
Post a Comment