The University of Dodoma: Department of Computer Science and Engineering

Download as odp, pdf, or txt
Download as odp, pdf, or txt
You are on page 1of 29

The University of Dodoma

Department of Computer Science and


Engineering

CP 223: Object Oriented Program Design and Analysis

Lecture 1: Introduction
Course descriptions
Advanced object oriented software development.
Use of the unified modeling language as a design
tool will be emphasized.
Course Objectives

The course introduces students to object oriented
approach to system analysis and design. UML
modeling is briefly introduced for specifying
software and database systems.
Learning outcomes
Upon completion of this course students should be able to;

– Demonstrate correct use of the basic C++/Java


features in a working program: objects, classes,
methods, IO handling, decisions and iterations.
– Apply the fundamental principles of OO programming.
– Masterkey principles in OO analysis, design, and
development
– Befamiliar with the application of the Unified Modeling
Language (UML) towards analysis and design,
– Demonstratecorrect use of the C++/Java features in a
working program:inheritance and encapsulation.
– Construct and interpret UML class diagrams
Course Contents
UML concepts:

– Introducing the Unified Modeling Language, Requirements Development,


Interaction Diagrams, Class Diagrams, Prototyping the GUI, External
and Internal Factors, apply UML based modeling techniques to system
analysis and design, use of some CASE tools.
Object oriented methods:

– Use of object oriented (O-O) approach to analysis, specification and


design, properties of languages: abstraction, encapsulation,inheritance,
implementation in O-O languages (c++/Java).
Program Design:

– modularisation, benefits of modular design, building hierarchies,


functional, decomposition, problems with simple decomposition,
afferent/transform/efferent, mappings, factoring, structure charts,
separating data and control, transaction flow, coupling.
The object model.

Event based program design and Software Design Patterns



Recommended
References/Textbooks:
Stephen R. Scach, 1999, Classical and Object – Oriented Software

Engineering with UML and C++, 4 th Edition, McGrawHill


Budgen, D., Software Design, Addison-Wesley, Reading, MA 1994.

Aho, V.A and Ulman, I.D., Foundations of Computer SEI Science,


Computer Science Press, NY 1992


Craig Larman, Applying UML and Patterns: An Introduction to Object-

Oriented Analysis and Design and the Unified Process, 2nd Edition
Joseph Schmuller Sams Teach Yourself UML in 24 Hours, 2nd

Edition
Deitel and Deitel, Java How to Program 3 rd Edition, prentice Hall Inc

Definition of Terms

Object Oriented Analysis
–This is concerned with developing an
object-oriented model of the application
domain. The objects in that model reflect the
entities and operations associated with the
problem to be solved.
Definition of Terms ...
Object Oriented Design

– Thisis concerned with developing an object-


oriented model of a software system to
implement the identified requirements. The
objects in an object-oriented design are
related to the solution to the problem.
There may be close relationships between
some problem objects and some solution
objects, but the designer inevitably has to
add new objects and to transform problem
objects to implement the solution.
Definition of Terms ...
Object Oriented Programming

– This
is concerned with realizing a software
design using an object-oriented
programming language, such as Java or
C++. An object-oriented programming
language provides constructs to define
object classes and a run-time system to
create objects from these classes.
Towards object orientation
Definition of Terms ...
An Object

– Anobject is an entity that has a state and a


defined set of operations that operate on
that state. The state is represented as a
set of object attributes. The operations
associated with the object provide
services to other objects (clients) that
request these services when some
computation is required.
Definition of Terms ...
An Object ...

– Objects have state, behavior, and identity


and are created according to an object
class definition. An object class definition
is both a type specification and a template
for creating objects. It includes
declarations of all the attributes and
operations that should be associated with
an object of that class.
Definition of Terms ...
A Class

– A classis a set of objects which have a


common structure and a common behavior.
An object is an instance of a class. A class
represents the abstract matrix of an object
before its instantiated.
Attribute

– This is an observable property of the objects


of a class.
Definition of Terms ...
Method

– Thisis an operation which can update the


value of the certain attributes of an object
E.g. We will add a public method to access
the age (then its going to be a method which
does not change any attribute of our object),
and another to modify this age. These two
methods are commonly called getters and
setters.
– class
Person { private: int Age; public: int
GetAge() { return Age; } public: void
SetAge(int newAge) { Age = newAge; } };
Examples on an Object,State, Class
and Methods
Other Terms ...
State

– The state of an object encompasses all of the


(usually static) properties of the object plus the
current (usually dynamic) values of each of these
properties.
Identity

– Identity is that property of an object which


distinguishes it from all other objects
Behavior

– This is how an object acts and reacts, in terms of its


state changes and message passing; the outwardly
visible and testable activity of an object.
Examples on State, Behavior and
Identity
Properties of Object Oriented
Development
The properties are ...

– Objects are abstractions of real-world or system


entities and manage themselves.
– Objectsare independent and encapsulate state
and representation information.
– System functionality is expressed in terms of
object services.
– Shared
data areas are eliminated. Objects
communicate by message passing.
– Objectsmay be distributed and may execute
sequentially or in parallel.
Why Object Oriented Development

Object Oriented Programming has a number of
advantages, namely
– Easier
maintenance. Objects may be
understood as stand-alone entities.
– Objects
are potentially reusable
components.
– Forsome systems, there may be an
obvious mapping from real world entities
to system objects.
Key Differences between Structured
and Object Oriented Analysis
Key Differences between Structured
and Object Oriented Analysis
Principles of Object Oriented
Paradigm

OOD has four principles, which help us manage
change and Complexity:
– Abstractions

– Encapsulations

– Generalization

– Polymorphism
Abstractions

Concepts and relationships are known as
abstractions. Classes and associations are
general abstractions, and objects and links are
specific abstractions.

A good abstraction is well defined and includes
essential information required for understanding it,
but excludes any irrelevant or incidental
information. An example is given in the next slide.
Abstractions

For example, when communicating about
managers, it is essential that we know their
names, but it is not essential for us to know how
many pets they own or the types of pets they own,
if any. Likewise, by considering various managers,
we can determine what similarities and differences
they have that allow us to classify them as
managers.
Encapsulation

This is combining attributes and operations to form
classes and objects and hiding methods behind
operations.

Combining attributes and operation to form classes
and objects is also known as localization. For
example, when there is a change to the Manager
class, such as a need to track the managers years of
experience, we simply need to go to the class and
update its attributes or operations rather than go to
one location to update the managers data (or
attributes) and another location to update its
processing (or operations).
Encapsulation ...

Hiding a method behind an operation is also
known as information hiding. For example, when a
manager directs the team to execute a project, the
team may use various techniques, and may
change techniques without impacting the
attributes or data.
Generalization
Polymorphism

Polymorphism shows that the Validate operation
appears in all the classes. It is identified or declared in
the Work Product class, perhaps with a default method,
but the Requirement class and System class provide
their own methods for validation. Hence the need for the
Requirement and System classes to list their own
Validate operations. Had these classes simply inherited
the default Validate functionality from the Work Product
class, you wouldn't list the Validate method again.

The ability to have multiple methods for a single
operation is called polymorphism.
Thank you ...

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy