Object Oriented Analysis & Design Week 1 - Introduction To Object Orientation
Object Oriented Analysis & Design Week 1 - Introduction To Object Orientation
Introduction
Tracing the Object Oriented Paradigm
Foundations of Object Orientation
Object Oriented Concepts
Strengths and weaknesses
Application areas
3
Part 1
INTRODUCTION
Introduction
4
As of April 2022, 63% of the global population was using the Internet ( Statista
Research Department, 2022). This goes to show how we have become so
dependent on the Internet and different applications to solve our day to day
problems.
This ranges from the use of Google (now an accepted English word meaning
‘to search for’ something, to cloud computing solutions, to Internet of Things
(IoT) devices, and offline corporate and retail programs (solutions).
Have you ever thought about how much work is put in to develop that
application that you find so convenient to solve your day to day problems?
For example applications that you download from the store for free?
Thankfully as a user one does not need to know the nitty gritty of the
development of these applications on their phones (or any other device for
that matter). What interests the user is that it works, and is easy to use, right?
Introduction (cont’d)
5
The general term used to refer to the different programs that you use whether off
or online is software. These are the engines that run the applications and games
that you use on a day to day basis.
With time programming languages have evolved to the point that programmers
can write very complex solutions while enabling you (the user) to only see the
details that you need to see to solve the particular problem. The use of
graphical user interfaces has become such a crucial factor that there is a whole
domain called user experiences (UX) that is exclusively dedicated to that.
However, every program is written to offer a solution to an identified problem.
There is a process that is followed in arriving at this solution which is covered in
greater detail in a course called software engineering.
This course, nonetheless, is concerned with an approach called the object
oriented approach. In this course the learner will understand how the object
oriented approach is used and why it is the approach of choice for today’s
software engineer (as mentioned earlier there are other approaches as well).
Every lesson is designed to build up on the previous one to enable the learner
follow the new concepts introduced and also understand the different tools and
concepts in object oriented analysis and design.
6
Part 2
THE OBJECT ORIENTED PARADIGM
2.1 Introduction
7
That one is able to confidently use software that has been designed to be so
easy to use attests to the strength of object oriented programming, which in
itself is a consequence of good object oriented analysis and design. The
relationship between the two shall be discussed in detail in later lessons.
In this lesson a trace to the object oriented (OO) paradigm is done, as well as
an introduction to foundation, concepts and technologies associated with
OO. A discussion of strengths and weaknesses of OO is also included.
2.2 Tracing the OO Paradigm
8
Selection: select (choose) just one action from a set or list of choices. For
example you are feeling hungry and want to spoil yourself during lunch time.
Go to ATM
Check account balance
If balance less than 100
Eat fries only
Otherwise if more than 100 but less than 200
Eat fries and burger
Otherwise if more than 200
Eat fries, burger and ice cream
2.2 Tracing the OO Paradigm
(cont’d)
14
Further, modular programming also allows the use of modules; thus it means
that the program can be broken down into several modules. Each module
can then fulfill a particular function, making it easier to break down the
requirements and fulfill them using different modules (the modules together
fulfill all the requirements).
Having the code (functionality) well structured (modular) makes it easier to
read (and debug too), test, makes it easy to find code and allows for
reusability.
2.2 Tracing the OO Paradigm
15
Data Abstraction Paradigm: This paradigm opened the door to the object
oriented paradigm and is indeed in use therein. The principle of abstraction
is also in use in many other areas notably in database management
structures. The concept is to hide details of the implementation at various
levels. For example in database systems there is a 3 layer hierarchy of
abstraction namely, physical, conceptual, and view levels. What this means
is that at every layer there is either increasing abstraction (less details) or
decreasing abstraction (more details).
The reasoning behind abstraction is to hide details from the user which they
do not need to know. This will be described in greater detail later on in this
lesson.
2.2 Tracing the OO Paradigm
16
Part 3
FOUNDATIONS OF OBJECT ORIENTATION
3.1 Introduction
19
OBJECT ORIENTATION
FOUNDATION
Encapsulation Hierarchy
Abstraction
Modularity
Also think about the products you buy in the supermarkets you visit; how
much do you need to know about the food or electronics you buy? Ever
heard a customer ask what food a chicken was fed on in order to determine
whether to buy it or not? Or what materials were used on the circuit board of
the pocket radio you wish to buy?
Abstraction therefore, helps to manage the complexity by doing away with
details that aren’t important in finding the solution to a problem and focusing
on what differentiates objects.
Without abstraction developing solutions using the OO approach would be
cumbersome and tiring; not to mention the possibility of even developing the
wrong solution due to too much detail ( what is also known as information
overload).
3.2.2 Encapsulation
23
Modularity refers to breaking down a complex system into smaller units that
are more manageable. These smaller units are usually built around
functionality and are fully functional on their own; thus they can be
managed independently.
Consider an example of a car. The car can be broken down into modules
such as engine and body modules. Engine modules can be further broken
down into mechanical and electrical modules. Body parts can be broken
down into passenger, boot and nose. Thus each module can be handled as
a unit on its own. This makes it easier to manage and proper attention can
be given to individual modules. The modules can then be integrated to
make up the larger system.
This can be demonstrated using fig 3; it shows the breakdown of the car into
different modules.
3.2.3 Modularity
26
Increasing
Car
abstraction
Vehicle
Pickup Car
28
Part 4
OBJECT ORIENTATION CONCEPTS
4.1 Introduction
30
A class is a grouping name for all objects that share the same properties,
behavior, relationships and connotations. A class therefore can be described as
a blueprint for a certain group of objects. This means that for the object to
belong to that class it must have the properties described for the class.
By definition an object is an instance of a class. From our knowledge of English
we know that an instance is simply an example or a single occurrence.
A class is an abstraction in that we only take account of the properties that are
of interest and suppress the others.
For example supposing we declare a class called dog. The properties of the dog
of interest are breed, shoulder height and color. The behavior of interest is its top
speed and how high it can jump. From this example you notice that there are
many properties and behavior we have not bothered with. For instance we
could have noted the age of the dog (not interested) or even the average
training period (again not interested).
Let us add a few more notations using an example closer to home like a course.
4.3 Class (cont’d)
34
The UML notations for both the class and the object shall be described in a
later lesson; by way of introduction both of them are described in a
rectangle. Now back to our example.
We can now describe our class as follows:
Class name: Course
Properties: Course Code, Name, YearOffered, CreditHours, Type
Behavior: Add student, delete student, print class list, enter student marks
Based on these details we can choose to instantiate the class.
Remember the class is just a blueprint from which to create instances
(members) of the class with their own unique identities and states
corresponding to the description of the class.
4.4 Attribute
35
Polymorphism literally means “many shapes”. In object orientation the term is used to refer
to when objects belonging to different classes implement a behavior (operation)
differently.
As can be seen polymorphism is closely related to inheritance since this is where different
implementations of the same operation is easily seen and implemented.
A classical example of this is the use of the “+” operator in object oriented programming
(don’t worry if you haven’t done programming yet, this explanation is simple). When two
integers (numbers) invoke this operator the result is the normal addition of numbers. For
example, 5 + 2 = 7. However, when the two numbers are declared strings then the “+”
concatenates the two strings. For example in this case 5 + 2 = 52. When it is actually two or
more strings then we have “none” + “the” + “less” = nonetheless.
Another example is yourself. When you are here listening to the lecture you are a student.
After the session you go home and become son/daughter/father/mother as the case
maybe. These are different implementations of yourself.
One other good example is provided by Ashrafi (2013). As a worker you “work”
(operation). However, different workers implement work operation differently. A
mechanic, chef, policeman and professor all implement the operation “work” differently.
4.6 Interface (Polymorphism) (cont’d)
38
Part 5
STRENGTHS AND WEAKNESSES OF OBJECT ORIENTED PARADIGM
5.1 Strengths
43
Since the paradigm is based on real world entities it makes it that much
easier for designers to come up with the classes for the design. As discussed
earlier if a student is an entity of interest in the system then the designer will
simply build a student class and describe the attributes and behavior of
interest to the student class.
Reuse is one of the key pillars of object oriented design; the same software
can be reused to solve similar problems in the domain. Further, inheritance
can also be used to extend functionality to developed classes. This has the
overall effect of increasing productivity across the board.
With the same principles in mind object oriented systems can accommodate
change. For example changes can be made to a class without having to
change all the code in the program.
Because of the foundations of object orientation namely encapsulation,
ability to isolate code (classes), and use of modularity the risk element is
vastly reduced during system development.
Other concepts such as polymorphism also introduce flexibility in the whole
design.
5.2 Weaknesses
44
Part 6
APPLICATION AREAS
Application areas of OO
46
Hypertext and hypermedia – ever done some basic HTML code writing? If
not then hypertext refers to media that “opens” other texts or media. What
this means is that you click on a link (the text) and it opens another text or
media. In essence the hypertext is a pointer to other text. The same
concept applies to hypermedia; it opens media such as sound or a movie
and so on. These technologies also utilize object oriented technology.
Neural networking – this is an area of artificial intelligence (AI) that utilizes
object oriented programming to simplify the process.
AI expert systems – these are written mostly in Python which is an object
oriented programming language.
CAD (Computer Aided Design) systems – these are systems used by
engineers in design and manufacturing environments. Object oriented tools
are used to increase the accuracy of flowcharts and blueprints used to
develop solutions.
Summary
48
Arlow, J., & Neustadt, I. (2013). Uml 2 and the unified process: Practical object-oriented analysis
and Design (Second). Addison-Wesley.
Ashrafi, N., & Ashrafi, H. (2014). Object Oriented Systems Analysis and Design (1st ed.). Pearson.
Bachmann, K.-H. (1966). Dijkstra, E. W.: A Primer of ALGOL 60 programming, A. P. I. C. Studies in
date processing, no. 2, Academic Press, London, New York 1962. XI + 114 Seiten. Preis 30 s.
Biometrische Zeitschrift, 8(1-2), 127–127. https://doi.org/10.1002/bimj.19660080123
Booch, G., Maksimchuk, R. A., Engle, M. W., Young, B. J., Conallen, J., & Houston, K. A. (2007).
Object-oriented analysis and design with applications (Third). Addison-Wesley.
Geeks for Geeks. (2022, July 7). Introduction of programming paradigms. GeeksforGeeks.
Retrieved September 13, 2022, from https://www.geeksforgeeks.org/introduction-of-
programming-paradigms/
Hernandez, B. (2022, March 21). 10 applications of Object Oriented Programming. 10
Applications of Object Oriented Programming. Retrieved September 13, 2022, from
https://www.quickstart.com/blog/10-applications-of-object-oriented-programming/
IBM Corporation. (n.d.). Subsystems. Rational Software Modeler 7.5.0 : Subsystems. Retrieved
September 13, 2022, from https://www.ibm.com/docs/en/rsm/7.5.0?topic=diagrams-subsystems
Morkar, V. (2021, April 20). What is the difference between structured and Object Oriented
Programming. Medium. Retrieved September 13, 2022, from https://vedant-
morkar19.medium.com/what-is-the-difference-between-structured-and-object-oriented-
programming-215ff563ca98
Ojo, A., & Estevez, E. (2005). (rep.). Object-Oriented Analysis and Design with UML - Training
Course (Vol. 1).
References (2 of 2)
50
Statista Research Department. (2022, April). Internet users in the world 2022. Statista. Retrieved
September 13, 2022, from https://www.statista.com/statistics/617136/digital-population-
worldwide/
Structured Programming - IT236 Course. Structured Programming. (n.d.). Retrieved September
13, 2022, from https://condor.depaul.edu/sjost/it236/documents/structured.htm
Tiny. (n.d.). Modular Programming: Definitions, benefits, and predictions. Blueprint - Blog by Tiny.
Retrieved September 13, 2022, from https://www.tiny.cloud/blog/modular-programming-
principle/#:~:text=Modular%20programming%20(also%20referred%20to,single%20aspect%20of%
20the%20functionality.
Tutorials Point. (n.d.). UML - component diagrams. Tutorials Point. Retrieved September 13, 2022,
from
https://www.tutorialspoint.com/uml/uml_component_diagram.htm?key=package%2Bdiagram
Tutorials Point. (n.d.). Java - packages. Tutorials Point. Retrieved September 13, 2022, from
https://www.tutorialspoint.com/java/java_packages.htm
University of Cambridge and the Raspberry Pi Foundation. (n.d.). The procedural paradigm.
Isaac Computer Science. Retrieved September 13, 2022, from
https://isaaccomputerscience.org/concepts/prog_pas_paradigm?examBoard=all&stage=all
University of Cambridge and the Raspberry Pi Foundation. (n.d.). The OOP Paradigm. Isaac
Computer Science. Retrieved September 13, 2022, from
https://isaaccomputerscience.org/concepts/prog_oop_paradigm?examBoard=all&stage=all