Information Technology Reference
In-Depth Information
component reuse, this use of the object-oriented paradigm can also provide
integrity for a software system. To explain this, let us consider again the monster
truck and its start method that we described in the beginning of the chapter.
The start method uses the ignition and a key in order to turn the vehicle on.
In fact, the insertion and rotation of the key are the only actions needed to start this
very complex mechanical system. In software engineering terms, this is referred to
as the use of an interface. Essentially, an interface provides a defined way for
using an object, and for accessing those properties of an object that are intended to
be accessed. The processes involved in turning on a vehicle are extremely
complex, and involve everything from the use of a proper fuel mixture to the
completion of certain electrical circuits to the correctly timed firing of pistons. For
the average operator of the vehicle, such in depth knowledge of the vehicle's
operation is unnecessary. In fact, were the operator required to manually specify
all of the settings and actions required to turn the vehicle on, we can safely assume
that our monster truck would never leave the sales lot. Luckily for us, these
intricacies are hidden from the user, and instead the monster truck is
engineered to perform these actions on its own, in response to an appropriate
interaction with a predetermined interface, in this case the vehicle's ignition.
This practice of hiding a system's inner workings is known as information
hiding. Information hiding is a key concept in the larger process at work here:
encapsulation. Booch describes encapsulation as the ''process of compartmen-
talizing the elements of an abstraction that constitute its structure and behavior''
(Booch 1994 ). By this, we mean that objects should be designed to separate their
internal composition and function from their external appearance and purpose.
As previously stated, this provides integrity in a software system. That integrity
results from the closing off of an object's internal workings so that the object in
question is only accessed in the desired manner, and unintended changes to the
object cannot be made by the program. Furthermore, encapsulation ensures the
independence of an object from the rest of a software system. The internalization
of an object's attributes and methods means that if a change is made to one part of
the system, the object maintains its integrity and functionality, and is still accessed
and will still respond in the intended manner. This localization of data facilitates
not only changes implemented during the original development process, but also
throughout the ongoing maintenance that the software will undergo during its
serviceable lifespan.
2.3.3 Access Levels
We have said that the use of modularity and encapsulation can provide integrity
within a software system through the use of information hiding. One key practice
that leads to this advantage is the designation of access levels within classes, and
Search WWH ::




Custom Search