You are on page 1of 32

Chapter2:Object Orientation the new software paradigm

DEBRE BERHAN UNIVERSITY


College of Computing
Department of Information System

System Analysis and design Lecture Note

Object Orientation the new software paradigm


by:
zeynu
zeynum4321@gmail.com
DBU 2015 E.C
System Analysis and design Lecture Note DEBRE BERHAN UNIVERSITY
Chapter2:Object Orientation the new software paradigm

Outline

1 Chapter2:Object Orientation the new software paradigm


Introduction to OO concepts
Orthogonal views of the software
Object Oriented system development methodology
Why object-orientation
Overview of the unified approach
Basics of OO concepts

System Analysis and design Lecture Note DEBRE BERHAN UNIVERSITY


Introduction to OO concepts
Orthogonal views of the software
Object Oriented system development methodology
Chapter2:Object Orientation the new software paradigm
Why object-orientation
Overview of the unified approach
Basics of OO concepts

Introduction

What is an Object?

A representation of a specific Objects have two aspects


entity in the real world 1 Information or attribute
May be tangible (physical 2 Behavior or
entity) or intangible Functionalities

System Analysis and design Lecture Note DEBRE BERHAN UNIVERSITY


Introduction to OO concepts
Orthogonal views of the software
Object Oriented system development methodology
Chapter2:Object Orientation the new software paradigm
Why object-orientation
Overview of the unified approach
Basics of OO concepts

Introduction

What is an Object?

A representation of a specific description of its


entity in the real world structure
May be tangible (physical
a state representing
entity) or intangible
its current condition
Objects have two aspects
1 Information or attribute 2 Behavior or
a unique identity Functionalities

System Analysis and design Lecture Note DEBRE BERHAN UNIVERSITY


Introduction to OO concepts
Orthogonal views of the software
Object Oriented system development methodology
Chapter2:Object Orientation the new software paradigm
Why object-orientation
Overview of the unified approach
Basics of OO concepts

Introduction

What is an Object?

A representation of a specific what can an object do?


entity in the real world
what can be done to it?
May be tangible (physical
entity) or intangible
Objects have two aspects
1 Information or attribute

a unique identity
description of its
structure
a state representing
its current condition
2 Behavior
System Analysis andor
design Lecture Note DEBRE BERHAN UNIVERSITY
Introduction to OO concepts
Orthogonal views of the software
Object Oriented system development methodology
Chapter2:Object Orientation the new software paradigm
Why object-orientation
Overview of the unified approach
Basics of OO concepts

cont..

Object: It is a real-world entity that has properties and methods.


Properties (or Attributes): It describes the state (or data) of an object
Example : car(Color, manufacturer, cost, model and owner ).

Methods (or Procedures): It defines its behavior (or operations)


Example:(Go, stop, turn left, turn right ) etc.
System Analysis and design Lecture Note DEBRE BERHAN UNIVERSITY
Introduction to OO concepts
Orthogonal views of the software
Object Oriented system development methodology
Chapter2:Object Orientation the new software paradigm
Why object-orientation
Overview of the unified approach
Basics of OO concepts

cont..

What is a class?

A general template we use to instances that share similar


define and create specific characteristics
instances, or objects
A set of logically related A class has two aspects

System Analysis and design Lecture Note DEBRE BERHAN UNIVERSITY


Introduction to OO concepts
Orthogonal views of the software
Object Oriented system development methodology
Chapter2:Object Orientation the new software paradigm
Why object-orientation
Overview of the unified approach
Basics of OO concepts

cont..

What is a class?

A general template we use to a named property of


define and create specific a class
instances, or objects values that instances
of the class may hold
A set of logically related
instances that share similar 2 Operation
characteristics implementation of a
service
A class has two aspects requested(any object
1 Attribute of a given class)

System Analysis and design Lecture Note DEBRE BERHAN UNIVERSITY


Introduction to OO concepts
Orthogonal views of the software
Object Oriented system development methodology
Chapter2:Object Orientation the new software paradigm
Why object-orientation
Overview of the unified approach
Basics of OO concepts

cont..

What is a class?

A general template we use to implementation of a


define and create specific service
instances, or objects requested(any object
A set of logically related of a given class)
instances that share similar
characteristics
A class has two aspects
1 Attribute
a named property of
a class
values that instances
of the class may hold
2 Operation
System Analysis and design Lecture Note DEBRE BERHAN UNIVERSITY
Introduction to OO concepts
Orthogonal views of the software
Object Oriented system development methodology
Chapter2:Object Orientation the new software paradigm
Why object-orientation
Overview of the unified approach
Basics of OO concepts

cont..

A class describes a group of objects with


similar properties (attributes),
common behaviour (operations),
common relationships to other objects,
and common meaning (“semantics”).

System Analysis and design Lecture Note DEBRE BERHAN UNIVERSITY


Introduction to OO concepts
Orthogonal views of the software
Object Oriented system development methodology
Chapter2:Object Orientation the new software paradigm
Why object-orientation
Overview of the unified approach
Basics of OO concepts

cont..

Object and Class


Objects are grouped into classes
Classes are used to distinguish one type of objects from another
A class is a set of objects that share a common structure and a common
behavior
Each object is an instance of a class
A class is a specification of,
Structure (instance variable)
Behaviour (methods)
Inheritance for objects

System Analysis and design Lecture Note DEBRE BERHAN UNIVERSITY


Introduction to OO concepts
Orthogonal views of the software
Object Oriented system development methodology
Chapter2:Object Orientation the new software paradigm
Why object-orientation
Overview of the unified approach
Basics of OO concepts

cont..

Example It represented by data


type and describe the
state of an object

Attributes or properties

System Analysis and design Lecture Note DEBRE BERHAN UNIVERSITY


Introduction to OO concepts
Orthogonal views of the software
Object Oriented system development methodology
Chapter2:Object Orientation the new software paradigm
Why object-orientation
Overview of the unified approach
Basics of OO concepts

cont..

Behavior or methods
An object behavior is described in methods or procedures
A method implements the behavior of an object.
Behaviour denotes the collection of methods that abstractly
describes what an object is capable of doing

System Analysis and design Lecture Note DEBRE BERHAN UNIVERSITY


Introduction to OO concepts
Orthogonal views of the software
Object Oriented system development methodology
Chapter2:Object Orientation the new software paradigm
Why object-orientation
Overview of the unified approach
Basics of OO concepts

Orthogonal views of the software

There are two different (and complementary) ways to view software


construction:
We can focus primarily on the functions or
We can focus primarily on the data
The heart of distinction between structured paradigm and object oriented
paradigm lies in their primary focus

System Analysis and design Lecture Note DEBRE BERHAN UNIVERSITY


Introduction to OO concepts
Orthogonal views of the software
Object Oriented system development methodology
Chapter2:Object Orientation the new software paradigm
Why object-orientation
Overview of the unified approach
Basics of OO concepts

cont..

1 Structured Paradigm
a development strategy based on the concept that a system should
be separated into two parts data and functionality
You develop a software in which data is separate from behavior
We have a program to access a database Focuses on the functions
of the system
2 Object Oriented Paradigm:A system is defined in a set of interacting
objects
Objects know things (have data) and do things (have functionality)
We have an application that exists in an object space (where both
the program and the data for the application reside
Centers on the object, which combines data and functionality

System Analysis and design Lecture Note DEBRE BERHAN UNIVERSITY


Introduction to OO concepts
Orthogonal views of the software
Object Oriented system development methodology
Chapter2:Object Orientation the new software paradigm
Why object-orientation
Overview of the unified approach
Basics of OO concepts

Object Oriented system development methodology

It is a way to develop software by building self-contained objects that


can be easily replaced, modified, and reused Object Orientation
view or model the world or the system as a set of interacting or
interrelated objects
In OO system, Software is a collection of discrete objects that
encapsulate their data as well as the functionality to model
real-world objects
In an OO system, everything is an object and each object is
responsible for itself.

System Analysis and design Lecture Note DEBRE BERHAN UNIVERSITY


Introduction to OO concepts
Orthogonal views of the software
Object Oriented system development methodology
Chapter2:Object Orientation the new software paradigm
Why object-orientation
Overview of the unified approach
Basics of OO concepts

Why object-orientation

In OO, systems are easier to adapt to changing requirements, easier to


maintain, more robust, and promote greater design and code reuse.
1 Modularity : system analysts can break complex system into
smaller, and more manageable modules
2 Higher level of abstraction : The OO approach supports
abstraction at the object level
Since objects encapsulate both data and methods, they work
at higher level of abstraction
makes designing, coding, and maintaining the system much
easier

System Analysis and design Lecture Note DEBRE BERHAN UNIVERSITY


Introduction to OO concepts
Orthogonal views of the software
Object Oriented system development methodology
Chapter2:Object Orientation the new software paradigm
Why object-orientation
Overview of the unified approach
Basics of OO concepts

cont..

3 Promotion of reusability
Via inheritance, classes can be built from each other Only
differences and enhancements between the classes need to be
designed and coded
All previous functionality (and data) remains and can be used
without change
The real advantage of using an OO-approach is that you can
build on what you already have.

System Analysis and design Lecture Note DEBRE BERHAN UNIVERSITY


Introduction to OO concepts
Orthogonal views of the software
Object Oriented system development methodology
Chapter2:Object Orientation the new software paradigm
Why object-orientation
Overview of the unified approach
Basics of OO concepts

Overview of the unified approach

unified approach(UA) is a methodology for software development


that combines the best practices, processes, and guidelines along with
the UML.

UML is a set of notations and conventions used to describe and model


an application independent of the development methodology or
programming language
It is a specific methodology that maps out when and how to use the
various Unified Modeling Language (UML) techniques for
object-oriented analysis and design
unified modelling language (UML) is a set of notations and
conventions used to describe and model an application.
Applying past development efforts to future projects will improve the
quality of the product and reduce the cost and development time.

System Analysis and design Lecture Note DEBRE BERHAN UNIVERSITY


Introduction to OO concepts
Orthogonal views of the software
Object Oriented system development methodology
Chapter2:Object Orientation the new software paradigm
Why object-orientation
Overview of the unified approach
Basics of OO concepts

Cont..

The Unified Process is a two-dimensional systems development process


described by a set of phases and workflows.
It consists of five core workflows: requirements, analysis, design,
implementation, test and
four phases: inception, elaboration, construction, and transition.

The phases describe how an information system evolves


through time.
A workflow is defined as a sequence of activities that
produces a result of observable value.

System Analysis and design Lecture Note DEBRE BERHAN UNIVERSITY


Introduction to OO concepts
Orthogonal views of the software
Object Oriented system development methodology
Chapter2:Object Orientation the new software paradigm
Why object-orientation
Overview of the unified approach
Basics of OO concepts

Cont..

The Unified Process is a two-dimensional systems development process


described by a set of phases and workflows.

System Analysis and design Lecture Note DEBRE BERHAN UNIVERSITY


Introduction to OO concepts
Orthogonal views of the software
Object Oriented system development methodology
Chapter2:Object Orientation the new software paradigm
Why object-orientation
Overview of the unified approach
Basics of OO concepts

Cont..

Each cycle goes through all four phases and addresses the development
of a core workflow:
Requirement: the product is the use case model
Analysis: the product is the analysis model
Design: the product is the design and the architecture model
Implementation: the product is the implementation model
Test: the product is the test model
The life cycle phase of the UP are as follows
Inception: the seed idea is developed
Elaboration: the software design or architecture is defined
Construction: the software is built
Transition: the software is turned over to the user

System Analysis and design Lecture Note DEBRE BERHAN UNIVERSITY


Introduction to OO concepts
Orthogonal views of the software
Object Oriented system development methodology
Chapter2:Object Orientation the new software paradigm
Why object-orientation
Overview of the unified approach
Basics of OO concepts

OOA Vs OOD

Object oriented analysis : concerned with specifying system


requirements and analyzing the application domain
Concerned with developing requirements and specifications
expressed as an object mode
Object oriented design : concerned with implementing the requirements
identified during OOA in the application domain
Provides an object-oriented model of a software system to
implement the identified requirement.

System Analysis and design Lecture Note DEBRE BERHAN UNIVERSITY


Introduction to OO concepts
Orthogonal views of the software
Object Oriented system development methodology
Chapter2:Object Orientation the new software paradigm
Why object-orientation
Overview of the unified approach
Basics of OO concepts

Basics of OO concepts

Abstraction
The idea of focusing on the common properties and behaviours of
the object within some context, and ignore what’s unimportant or
irrelevant within the context.
Example 1
person class- essential X-stics of a person that we care about?
hard to say because person is so vague and we have not
defined.abstractions you create are relative to some context.
creating a driving app, you would care about a person in the
context of a driver.You can consider driving - licence -
number as an attribute.
student- some of the essential characteristics of a student?
the role-number, courses-name and grades in each course.
but a course, the student’s grade value may change but
student always have a grade attribute.

System Analysis and design Lecture Note DEBRE BERHAN UNIVERSITY


Introduction to OO concepts
Orthogonal views of the software
Object Oriented system development methodology
Chapter2:Object Orientation the new software paradigm
Why object-orientation
Overview of the unified approach
Basics of OO concepts

cont..

Inheritance
a relationship between classes where one class is the parent class of
another (derived) class.
allows classes to share and reuse behaviours and attributes.
The real advantage of inheritance is that we can build and reuse
what we already have.
An object-oriented system organized classes into a
“Subclass-Super class hierarchy”.
At the top of the hierarchy are the most general (base)
classes and at the bottom are the most specific classes
(sub-classes).
The parent class also is known as the bases class or super
class.
A subclass inherits all of the properties and methods
(procedures) defined in its super class.

System Analysis and design Lecture Note DEBRE BERHAN UNIVERSITY


Introduction to OO concepts
Orthogonal views of the software
Object Oriented system development methodology
Chapter2:Object Orientation the new software paradigm
Why object-orientation
Overview of the unified approach
Basics of OO concepts

cont..

Example1

Example2
System Analysis and design Lecture Note DEBRE BERHAN UNIVERSITY
Introduction to OO concepts
Orthogonal views of the software
Object Oriented system development methodology
Chapter2:Object Orientation the new software paradigm
Why object-orientation
Overview of the unified approach
Basics of OO concepts

cont..

Encapsulation (Information hiding)


the process of binding both attributes and methods together within
a class.
internal details of a class can be hidden from outside.
It permits the elements of the class to be accessed from outside
only through the interface provided by the class.
Encapsulation protects the data from corruption
Providing an interface to each object in such a way as to
reveal as little as possible about inner workings.
Encapsulation means in general, protection mechanism by
using access specifiers such as public, protected and private.

System Analysis and design Lecture Note DEBRE BERHAN UNIVERSITY


Introduction to OO concepts
Orthogonal views of the software
Object Oriented system development methodology
Chapter2:Object Orientation the new software paradigm
Why object-orientation
Overview of the unified approach
Basics of OO concepts

cont..

Example

System Analysis and design Lecture Note DEBRE BERHAN UNIVERSITY


Introduction to OO concepts
Orthogonal views of the software
Object Oriented system development methodology
Chapter2:Object Orientation the new software paradigm
Why object-orientation
Overview of the unified approach
Basics of OO concepts

cont..

Polymorphism (Information hiding)


Poly means “Many” and morph means “Form”
Polymorphism means that the same operation may behave
differently on different classes

Example1

System Analysis and design Lecture Note DEBRE BERHAN UNIVERSITY


Introduction to OO concepts
Orthogonal views of the software
Object Oriented system development methodology
Chapter2:Object Orientation the new software paradigm
Why object-orientation
Overview of the unified approach
Basics of OO concepts

cont..

Polymorphism (Information hiding)


Poly means “Many” and morph means “Form”
Polymorphism means that the same operation may behave
differently on different classes

Example1

System Analysis and design Lecture Note DEBRE BERHAN UNIVERSITY


Introduction to OO concepts
Orthogonal views of the software
Object Oriented system development methodology
Chapter2:Object Orientation the new software paradigm
Why object-orientation
Overview of the unified approach
Basics of OO concepts

cont..

Compute Payroll represents polymorphism

Example1

System Analysis and design Lecture Note DEBRE BERHAN UNIVERSITY


Introduction to OO concepts
Orthogonal views of the software
Object Oriented system development methodology
Chapter2:Object Orientation the new software paradigm
Why object-orientation
Overview of the unified approach
Basics of OO concepts

System Analysis and design Lecture Note DEBRE BERHAN UNIVERSITY

You might also like