AN INTUITIVE
INTRODUCTION
TO
OBJECT ORIENTED
SOFTWARE DEVELOPMENT (OOSD)
USING THE UML
(This
version assumes that this whole document has been read before its oral
presentation.)
(
It
is recommended that first-timers, read the summary
and conclusions before beginning this
presentation.)
NOTE: green colored text designates critically important concepts in this presentation.
The object oriented paradigm ("Paradigm" means a way of thinking, an overall approach.) has replaced the structured programming paradigm as they optimum strategy for developing modern software. This means that the "old fashioned" way of developing software, "programming", has been superseded by the "object oriented" approach . Unfortunately, many current textbooks do not effectively present the object oriented paradigm, probably because they are written by authors who were schooled in structured programming and have not made the necessary transition to the "new way of thinking". The following presentation attempts to address this problem by introducing the fundamental ideas of OOSD via an intuitive approach (based on common sense) and contrasting the older programming paradigm and the newer object oriented paradigm. Specifically this intuitive introduction to the object oriented paradigm has the following goals:
The key
problem
that
this presentation attempts to address is that current
textbooks do NOT effectively present the foundation of modern software
development, the object oriented paradigm. Instead, too
many still utilize the old fashioned, "programming" paradigm or, what
is
almost as bad, try to present object oriented paradigm with programming
terms,
e.g. even the term "object
oriented
'programming'" is misleading,
because "programming", by definition is
"algroithm oriented". (Note that
programming is sometimes called the "classical"
paradigm.) You should note,
however, that
OOSD
is a superset of Structured programming; this is explained
later.
The following table emphasizes the necessary shift in
terminology
required
to transition from structured programming (SP) to object oriented
software
development (OOSD). (Notice that the word "programming" does not
even appear in my presentation of the OO paradigm. The reason I
abandon
"programming" is because it represents the "do this" approach to
software
development, The
OOSD paradigm is a "model this" approach , a
fundamental
reorientation of the strategy IN software development. WARNING;
typical
current textbooks still use "programming" so you should be careful to
remember the word's meaning has to change dramatically to apply to OOSD.)
COMPARISON
OF THE OBJECT ORIENTED AND PROGRAMMING PARADIGMS
OO stands for "object oriented".
UML stands for the Unified
Modeling Language, the standard "language" for Object Technology,
explained below.
|
|
|
|
|
|
(Algorithm Oriented) |
|
|
|
|
|
1. object architecture models 2. operation algorithms |
1. UML diagrams 2. flowchart for algorithms |
|
This
table
is the foundation of this presentation, and it attempts to concisely
relate
some of the most important concepts in computer science, so take
time to analyze the table. If you are a beginning
software
developer, you can not fully understand all of it, but don't let that
worry
you;
you should return to this table frequently
as your experience with OOSD expands. (Hopefully, if
you are a computer science student, by the time you graduate, you can
draw
your own table, because you "understand" all these ideas and
won't need "Tony's representation of them" anymore! The tabular
format
provides a memorable structure that helps you organize and focus
your
thinking on the essential features of OOSD. Therefore,
SAQ1:
(
A SAQ is a "Self
Assessment
Question", that may be skipped on a first reading, but should be
adequately
answered before concluding the study of this presentation.)
In the preceding table, what is the most important difference in the
items
in the last column (Software Implementation) and all those to their
left?
SAQ2:
What is the primary (a) similarity and (b) difference of the abstract
foundations
of the programming paradigm and object oriented paradigm?
2. THE EVOLUTION OF SOFTWARE DEVELOPMENT FROM PROGRAMMING TO OOSD:
The OOSD paradigm is the latest stage in what has been a continuous evolution away from the concept of one big "program" . The very first software, machine language programs written in binary code ("1s" and "0s"), were called "programs" to reflect the fact they were a single, long sequence of machine language instructions, i.e. a program of instructions, like a recipe. These "programs" evolved from machine language programs through assembly language programs to programs written in high level (English-like) languages. Finally, in the structured programming paradigm (still the focus of many text books), the big program was subdivided into "miniprograms' called " functions " and "procedures ". The replacement of detailed instructions with meaningfully named modules (the "miniprograms") is called " abstraction ". This modularization of programs was the first step in the transition from "structured programming" to "OOSD".
SAQ3: "Encapsulation" is a fundamental feature of OOPL. What is encapsulated in what?
3. FUNDAMENTAL CONCEPTS OF THE OO PARADIGM, AN INTUITIVE INTRODUCTION:
Now
that we
have laid a foundation of the fundamental ideas of OOSD, we are ready
to
generate the concepts involved in OOSD, we can show how these concepts
are represented and a software architecture is modeled. The
following
is an intuitive introduction using the best, most
concise
example
(that I can think of) called a "Geometry
Application"; I use this to illustrate
all the basic constructs of object
oriented software design as well as the simple, basic strategy for
developing
an object oriented software architecture. Note that
in
real OOSD, the developer would utilize UML diagrams from start to finish,
but, in order to establish an intuitive foundation to OOSD, I use
simple
illustrations that I later translate into UML class diagrams.
Hopefully, you will see that that OOSD and its UML representation
are
based on simple, intuitive ideas and common sense reasoning!
|
AS AN ABSTRACT OBJECT |
![]() |
|
FIRST DRAFT OF OUR SIMPLE GEOMETRY APPLICATION |
![]() |
| This is equivalent to the UML
class diagram introduced in MODULARIZATION OF
SOFTWARE. |
TPQ1:
(
A TPQ is a "Thought Provoking Question" that you probably don't have
enough
info to answer completely.) What is
the significance of "highly cohesive" and "loosely coupled"
characteristics
of abstract objects? (
Note that these fundamentally important concepts are often mentioned
but
seldom explained or exemplified in typical OOSD textbooks.)(
Note that his is a "TPQ", an example of Tony's "thought provoking
questions"
rather than an "SAQ" because, if you have
not had an introduction to OOSD, you will not "know" the answer to the
question; however, even if you don't
"know" the answer,
it
is good to "think" about this fundamental feature of OOPL. I will
discuss some of this in the hints and answers to this question.)
SAQ4: In OOSD, what is the (a) similarity and (b) difference between built-in types and user-defined types.
In the preceding abstract object model we have distinguished the two essential "members" of any abstract object, its "state" (defined, in the UML, by the object "attributes ") and its "behavior" (defined, in the UML, by the object " operations"). In order to create an abstract object we must be able to model, not only the object, but its state and behavior as well. Note that behavior is the way that an object alters its state.
- Note that we use only one object, testCircle , in the main program of the UserI/O object, but we could have used as many as we desire. Each would be an "instance " of the Circle object. However, to keep things as simple as possible (so we can focus on illustrating concepts) I have used only one real object, testCircle.
- The <I/O components> in the state of the UserI/O object means that the details of how the input/output (I/O) is left unspecified. These would depend on whether the UserI/Oobject was a GUI (graphical user interface), a CLI (command line interface), an audio interface (I/O by voice), etc.
- In this model we have added some detail by specifying the "type" of the Circle object attributes , e.g. center is of type Point and radius is of type Number. (We could have defined the circle's center with coordinates x and y, but instead, realizing that the center is, in the real world, a "point" in two dimensional space, we "choose" to define center to be of type Point .) All software development languages have several built in number types so we can choose any one of these to specify radius .
However, Point is not a built-in type.
So what do we do? (Think about this!) ----- You got it; create a "new type" (a developer defined type) by modeling a real world point with an abstract object called "Point "! ( We could continue creating other objects, but we have what we need to illustrate many of the fundamentals of OOSD , so let's look at the relationships between Point and the other objects in our abstract object architecture.)
|
Prototype Architecture for a Geometry Application |
|
|
| The solid line link between Circle and Point represents the "has-a" relationship; in UML terminology this is called "association". The dashed link between classes represents the "uses-a" relationship; in UML terminology this is called "dependency". Note that UserInterface uses-a Circle because the method main() contains a local variable, testCircle (not shown), that is declared to have a type Circle. |
|
showing only the distinctive elements for an Expansion of Geometry Application Architecture |
![]() |
| The triangular arrow represents the "is-a" relationship between classes; in OOPL terminology this is "inheritance"; in UML terminology it is "generalization". Italics represent an "abstract" class that can not be made into a real object. |
5. SUMMARY (Critically important concepts are colored green.):
![]()
To
help me critique and improve this presentation, please fill in the Feedback
form associated with this presentation and give it to me or
to
your teacher who will forward it to me. If you do not receive
a printed copy of this feedback form at the presentation, please
print
a copy and submit that. Remember,
your answers on this form will NOT affect your grade in any way, so
please
be frank (and thoughtful).
If
you are interested in learning JavaScript, the language I recommend
for novice software developers for 13
reasons , then you might try to work through the JavaScript
Thread that is part of
my
course COSC 330. I try, very hard, to the focus on "what you are
doing (i.e. OOSD)" in my presentation that supplements an
over-simplified
text.