The previous three lessons presented an overview of the two major software
development paradigms: the procedural paradigm and the object oriented
paradigm. In this lesson, these two paradigms are compared and the relative
strengths and weaknesses of each paradigm are addressed. In addition,
both paradigms are assessed according to the six software quality characteristics
presented earlier.
According to Korson and McGregor [1990], "a
design paradigm is characterized by its view of the decomposition process."
The decomposition process refers to the way that a given paradigm divides
designs into logical units. The procedural paradigm "takes a task-oriented
point of view, which begins its support for the design process when
a solution to the target problem is proposed. The proposed solution
is decomposed by breaking it into a sequence of tasks. These tasks form
the basic building blocks for a procedural application." This means
that the procedural paradigm really only begins after the designer has
identified a possible solution. This solution is then decomposed into
various logical modules and submodules (functions and procedures) according
to the action they accomplish. Once the design is implemented, the execution
of the tasks can easily be traced from start to finish.
Earlier the example of sorting a list of numbers was given to illustrate
task-based decomposition. The solution to the sorting problem was divided
into the following tasks: inputting the numbers, using the selection
sort, and outputting the sorted numbers. Then the second task, using
the selection sort, was further divided into the tasks of finding the
smallest number and swapping two numbers. The diagram to the right shows
a representation of the order in which these tasks are performed to
sort three numbers.
In contrast to the procedural paradigm, the object oriented paradigm
supports the complete software development life cycle from analysis
to design to programming. The procedural paradigm only supports the
design and programming steps since a potential solution must be specified
before task decomposition can begin. The object oriented paradigm circumvents
this restriction by providing a comprehensive approach to software development.
Rather than taking a task-based view of design, "the object oriented
paradigm assumes a modeling point of view. The
model
is constructed by viewing the problem domain as a set of interacting
entities and the relationships between them" [Korson
and McGregor 1990]. Entities are modeled by designing classes to
represent them and then using these classes to instantiate objects.
This approach was demonstrated by the Figure classes in the previous
lesson. Relationships between objects are modeled through inheritance
and through the communication mechanism of message passing. While programs
designed with the procedural paradigm are essentially a sequence of
tasks, programs designed with the object oriented paradigm are essentially
a set of objects interacting with each other through message passing.
The six software quality characteristics in the table below provide
another way for software engineers to assess the pros and cons of the
two software development paradigms. By using these characteristics for
assessment, software engineers seek to answer the question, "Does
this paradigm produce software which is more maintainable, more reliable,
more portable, etc.?"