Information Technology Reference
In-Depth Information
The advent of the object-oriented paradigm had a profound change on the field
of software engineering. The use of objects allows software engineers to create
models of the real world in ways that had been previously thought impossible.
After all, software seeks to facilitate real-world situations, many of which cannot
rightly be broken down into a simple sequence of instructions to be carried out in
line-by-line order. Consider a local bank that, like any bank, stores money for
some number of clients. The classical model would have led to the creation of a
program consisting of many lines of code that dictate the exact order of operations
to be performed. Code created in this manner could never be very well organized.
This is not due to a fault of the programmer, however, it is the classical paradigm
that provided no system for breaking the program down into logical pieces. This
created a need for the objected-oriented paradigm, which allows us to model the
bank in a way that is logical for our system, capturing and focusing on the
important details, while leaving out those that are less important. This concept,
known as abstraction, allows us to create various objects that each represent
various portions of the bank, such as clients, bank accounts, employees, and
money transactions (Jia 2003 ). In the end, the object-oriented method allows us to
design and implement a software system more intuitively, compartmentalized, and
manageable than previously possible using the classical method. In this chapter,
we will discuss the specifics that make this possible.
2.1 What is an Object?
In the real world, an object can be anything at all from a pencil to a monster truck.
If it has a name, certain characteristics, and certain actions that can be done to it or
be accomplished with it, then simply put it is an object. Objects characteristics can
take on many forms, forms as simple as color to as complex as molecular structure.
Likewise, an object in the world of computer programming is an entity with
attributes that belong to and describe it. These attributes can be actions the object
is capable of performing, an interface to access those attributes and actions, and
most importantly, a unique identity. An object is a specific instance of a class,
which can be thought of as a blueprint for that object (classes will be discussed
further in the next section). Because a single class can be used to create many
objects, an object's unique identity is crucial in distinguishing it from other
objects. Think of the monster truck that we mentioned earlier. Just like our soft-
ware object comes from some defining class, the monster truck object might
be an instance of the class truck . We use the identifier ''monster truck'' to ensure
that we can distinguish it from other instances of the truck class, such as fire
truck , pickup truck ,or dump truck . An object inherits most of its attri-
butes from its class, but these attributes may differ amongst the object instances of
that class. An object is described as being in a certain state at any given moment,
which is defined by the value of its attributes. The state of an object plays a critical
Search WWH ::




Custom Search