0% found this document useful (0 votes)
23 views43 pages

Oose 1

This document provides an overview of object-oriented software engineering. It discusses the key concepts of object-oriented development including classes, objects, encapsulation, inheritance and polymorphism. It contrasts the traditional procedural approach with the object-oriented approach, noting that OO development focuses on modeling real-world objects and allows for easier maintenance, reuse and adaptation to changing requirements. The unified approach combines best practices from various OO methodologies and uses the Unified Modeling Language (UML) for modeling applications.

Uploaded by

lydiaessayass
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views43 pages

Oose 1

This document provides an overview of object-oriented software engineering. It discusses the key concepts of object-oriented development including classes, objects, encapsulation, inheritance and polymorphism. It contrasts the traditional procedural approach with the object-oriented approach, noting that OO development focuses on modeling real-world objects and allows for easier maintenance, reuse and adaptation to changing requirements. The unified approach combines best practices from various OO methodologies and uses the Unified Modeling Language (UML) for modeling applications.

Uploaded by

lydiaessayass
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 43

Object Oriented Software Engineering

Compiled by Samuel.A
Activity # 1

Overview of O-O systems Development


• Introduction
• Two orthogonal view of the software
• OO systems development methodology
• Why an Object Orientation
• Overview of the Unified Approach
Learning outcomes
• At the end of this activity, You should be able to define and
understand
– The object-oriented philosophy and why we need to study it
– The unified approach
– What an object and class is
Target Group
CS 2rd year

BiT, O-O Software Engineering


,Compiled by Samuel.A
Introduction
• Software development is dynamic and always undergoing
major changes.
– The methods we will use in the future will differ significantly from
those currently in practice.
– We can anticipate which methods and tools are going to succeed,
but we can not predict the future.
• Today a vast number of tools and methodologies are available
for systems development.
• Systems development refers to all activities that go into
producing an information systems solution.
– Systems development activities consist of systems analysis,
modeling, design, implementation, testing and maintenance.

BiT, O-O Software Engineering


,Compiled by Samuel.A
Cont’d
 Object oriented software engineering (OOSE) is an
object modeling language and methodology
developed by Ivar Jacobson in 1992.

BiT, O-O Software Engineering


,Compiled by Samuel.A
Cont’d
• Object-oriented Software Engineering is the use of object
technologies in building software.
• Object technologies is often used to encompass all aspects of
an object-oriented view and includes analysis, design, and
testing methods; programming languages; tools; databases;
and applications that are created using object-oriented
approach.

BiT, O-O Software Engineering


,Compiled by Samuel.A
Two orthogonal views of the software
• Two paradigms of software development,
I. Traditional system development methodology
II. Object oriented system development methodology
• The fundamental difference between the object oriented
systems and their traditional counterparts is the way in which
you approach problems.
• Most traditional development methodologies are either
algorithm centric or data centric.
– In an algorithmic centric methodology, you think of an algorithm
that can accomplish the task, then build data structures for that
algorithm to use.
– In a data centric methodology, you think how to structure the
data, then build the algorithm around that structure.
BiT, O-O Software Engineering
,Compiled by Samuel.A
Traditional Approach
• Traditional software development technique view software as a
collection of programs(or functions) and isolated data.
• The traditional approach to software development tends toward
writing a lot of code to do all the things that have to be done

BiT, O-O Software Engineering


,Compiled by Samuel.A
Object-Oriented system development
Methodology
• Object oriented systems development is a way to develop
software by building self contained modules or objects that can
be easily replaced, modified, and reused.
• It encourages a view of the world as a system of cooperative
and collaborating objects.
• In an object oriented environment, software is a collection of
discrete objects that encapsulate their data as well as the
functionality to model real world objects.
• Object oriented approaches attempt to build models that
mimic the real world.

BiT, O-O Software Engineering


,Compiled by Samuel.A
Con’t
• Many systems we want to build involve things that exhibit
behavior as well as having structure, and also may exhibit time-
dependent aspects.
• Each object has attributes (data) and methods (functions).
– Objects are grouped into classes.
• In object oriented terms, we discover and describe the classes
involved in the problem domain

BiT, O-O Software Engineering


,Compiled by Samuel.A
Difference between traditional and OO Approach

Traditional approach Object oriented system Approach


Collection of procedures (functions) Combination of data and functionality
Focuses on function and procedures, Focuses on object. Classes, modules
different styles and methodologies that can be easily replaced modified
for each step of process and reused

Moving from one phase to another Moving from one phase to another
phase is complex phase is easier
Increases duration of project Decreases duration of project
Increase complexity Reduces complexity and redundancy

BiT, O-O Software Engineering


,Compiled by Samuel.A
Why an object orientation

• Object oriented methods enable us to create sets of objects


that work together synergistically to produce software that
better model their problem domains .
• OO systems are easier to adapt to changing requirements,
easier to maintain, more robust, and promote greater design
and code reuse.
• OO development allows us to create modules of functionality.

BiT, O-O Software Engineering


,Compiled by Samuel.A
Cont’d
 It leads to higher maintainability of software modules because its
structure is inherently decoupled.
 It leads to object-oriented system that are easier to adapt and
easier to scale, i.e, large systems are created by assembling
reusable subsystems.
 Faster development, Reusability, Increased Quality

 The reasons why object orientation works


– High level of abstraction.
– Encouragement of good programming techniques.
– Promotion of reusability.
– Seamless transition among different phases of software development

BiT, O-O Software Engineering


,Compiled by Samuel.A
Cont’d

• High level of abstraction


– The Top-down approach supports abstraction of the function
level.
– The OO approach supports abstraction at the object level. The
object encapsulate both the data (attributes) and functions
(methods), they work as a higher level of abstraction. The
development can proceed at the object level, this makes
designing, coding, testing, and maintaining the system much
simpler.

BiT, O-O Software Engineering


,Compiled by Samuel.A
Cont’d
• Seamless transition among different phases of software
development
– The Traditional Approach to software development requires
different styles and methodologies for each step of the process.
So moving from one phase to another requires more complex
transition.
– The OO approach, use the same language to talk about analysis,
design, programming and database design. This seamless
approach reduces the level of complexity and redundancy and
makes for clearer, more robust system development.

BiT, O-O Software Engineering


,Compiled by Samuel.A
Cont’d
• Encouragement of good programming techniques.

– Raising the level of abstraction from function level to object level


and focusing on the real-world aspects of the system, the object
oriented method tends to
• Promote clearer designs.
• Makes implementation easier.
• Provide overall better communication.

BiT, O-O Software Engineering


,Compiled by Samuel.A
Cont’d
• Promotion of Reusability:
– Objects are reusable because they are modeled directly out of real
world. The classes are designed generically with reuse.
– The object orientation adds inheritance, which is a powerful
technique that allows classes to built from each other.
– The only different and enhancements between the classes need to
be designed and coded. All the previous functionality remains and
can be reused without change.

BiT, O-O Software Engineering


,Compiled by Samuel.A
Overview of Unified Approach
• The unified Approach(UA) is a methodology for software
development.
• The UA, based on methodologies by Booch, Rumbaugh, and
Jacobson tries to combine the best practices, processes and
guidelines for OO software development along with the
object management groups unified modeling language
• UA utilizes the unified modeling language(UML) which is a set
of notations and conventions used to describe and model an
application
• Or The unified modeling language (UML)is a language for
specifying, constructing, visualizing and documenting the
software system and its components.

BiT, O-O Software Engineering


,Compiled by Samuel.A
Object Basics
• Informally , an object represents an entity, either physical,
conceptual, or software
• A more formal definition, an object is a concept, abstraction, or
thing with sharp boundaries and meaning for an object
• An object is an entity.
– It knows things(has attributes)
– It does things(provides services or has methods)
• For instance, Object’s attributes
– Attributes represented by data type
– They describe objects states
– In the Car example, the car’s attributes are:
• Color, manufacturer, cost, owner, model
BiT, O-O Software Engineering
,Compiled by Samuel.A
Cont’d
• Object’s methods
– Method defines objects behavior and specify the way in which an
object’s data are manipulated.
– In the Car example, the car’s method’s are: Drive it, lock it, tow
it, carry passenger in it
• Object know things(attributes)
– I am an Employee.
• I know my name, social security number and my address
– I am a car.
• I know my color, manufacturer, cost, owner and model
• Object does things(methods)
– I know how to compute my payroll(Employee)
– I know how to stop(car)
BiT, O-O Software Engineering
,Compiled by Samuel.A
Cont’d
• In an object oriented system, everything is an object. Object is
whatever an application wants to talk about
• Objects are grouped in classes
• Classes are used to distinguish one type of object from another
• A Class is a set of objects that share a common structure and a
common behaviour
• A single object is simply an instance of a class
• A class is a specification of structure (instance variables),
behavior(methods), and inheritance for objects

BiT, O-O Software Engineering


,Compiled by Samuel.A
cont’d
• Classes are an important mechanism for classifying objects
• Main role of a class is to define the properties and procedures
(the state & behavior) and applicability of its instances

• In an OO system, a method or behavior of an object is defined


by its class
• Each object is an instance of a class
BiT, O-O Software Engineering
,Compiled by Samuel.A
BiT, O-O Software Engineering
,Compiled by Samuel.A
BiT, O-O Software Engineering
,Compiled by Samuel.A
• in object-oriented programming technique, we design a
program using objects and classes.
• An object in Java is the physical as well as logical entity
whereas a class in Java is a logical entity only.

BiT, O-O Software Engineering


,Compiled by Samuel.A
BiT, O-O Software Engineering
,Compiled by Samuel.A
Cont’d
• Attributes: object state and properties
– Properties represent the state of an object.
– Eg attributes of car object

• Methods: object behavior and operation


– The set of things that an object do
– what do objects have to do with system development” rather
that “what is an object?”

BiT, O-O Software Engineering


,Compiled by Samuel.A
Cont’d
• A car is an object a real-world entity, identifiably separate
from its surroundings. A car has a well-defined set of
attributes and methods in relation to other object.

BiT, O-O Software Engineering


,Compiled by Samuel.A
Cont’d

BiT, O-O Software Engineering


,Compiled by Samuel.A
BiT, O-O Software Engineering
,Compiled by Samuel.A
//Creating Student class.
class Student{
int id;
String name;
}
//Creating another class TestStudent1 which contains the main
method
class TestStudent1{
public static void main(String args[]){
Student s1=new Student();
System.out.println(s1.id);
System.out.println(s1.name);
}
}
BiT, O-O Software Engineering
,Compiled by Samuel.A
//Creating multiple objects.

BiT, O-O Software Engineering


,Compiled by Samuel.A
Another Example

BiT, O-O Software Engineering


,Compiled by Samuel.A
Another Example cont..
In the above figure, a person is an object. First state of the
person (object) is black hair which can be represented in Java
like this: hairColor = “black”.

In the same way, second property of the object is eye color


which can be represented in Java like eyeColor = “black” and
so on. These are called attributes that define the properties of
a person.
Let’s consider the behaviors or actions of a person. The actions
of a person may be “eat, sleep, walk, play, and study”. We
represent these actions in Java like this: eat(), sleep(), walk(),
play(), and study(). These are called methods.
Thus, when properties and actions are combined together of
any real-world object, make an object in Java.
BiT, O-O Software Engineering
,Compiled by Samuel.A
Exercise
1. Let’s take one more interesting example ‘Phone Samsung
Galaxy’. If I tell you to represent this phone in java in the
form of an object then How will you do like that?

BiT, O-O Software Engineering


,Compiled by Samuel.A
• Real-time example 1:
• Let us consider two objects Samsung Galaxy S4 and iPhone.
Suppose Samsung Galaxy S4 have some properties like width
= “6.98 cms”, height = “13.6 cm”, OS = “Android”, brand =
“Samsung”, price = “1000$” and actions are call(),
sendMessage(), browser(), share().
• Now, suppose iPhone has some properties such as width =
“5.86 cm”, height = “12.3 cms”, OS = “iOS”, brand = “Apple”,
price = “1200$” and actions are call(), sendMessage(),
browse(), share().
• Both objects have the similar properties and actions, but the
type is the same “Phone”. This is the class. i.e the name of the
class is “Phone”.

BiT, O-O Software Engineering


,Compiled by Samuel.A
• Realtime example 2:
• Consider two different objects one boy and one girl.
The boy has some properties like hairColor = “black”,
eyeColor = “black”, skinColor = “Fair”, height = “5.10
inch”, weight = “65 kg” and actions are read(), play(),
sleep(), walk().
• A girl has some properties like hairColor = “brown”,
eyeColor = “brown”, skinColor = “milky white”, height
= “5.4 inch”, weight = “50 kg” and actions are read(),
play(), sleep(), walk(). Here, the type of both boy and
girl is the same. Type is “Person”. So, the class name
is “Person”.

BiT, O-O Software Engineering


,Compiled by Samuel.A
• Realtime example 2:
• Consider two different objects one boy and one girl.
The boy has some properties like hairColor = “black”,
eyeColor = “black”, skinColor = “Fair”, height = “5.10
inch”, weight = “65 kg” and actions are read(), play(),
sleep(), walk().
• A girl has some properties like hairColor = “brown”,
eyeColor = “brown”, skinColor = “milky white”, height
= “5.4 inch”, weight = “50 kg” and actions are read(),
play(), sleep(), walk(). Here, the type of both boy and
girl is the same. Type is “Person”. So, the class name
is “Person”.

BiT, O-O Software Engineering


,Compiled by Samuel.A
Messages
• Objects communicate through passing messages.
• A message is a request for performing an operation by some
object in the system.
• A message may consist of the identification of the target
object, name of the requested operation and other relevant
information for processing the request.
• An object which originates a message is called the sender and
the object which receives a message is called the receiver .

BiT, O-O Software Engineering


,Compiled by Samuel.A
Message Exchange in Classes

BiT, O-O Software Engineering


,Compiled by Samuel.A
Inheritance
• We may organize our knowledge in terms of hierarchy of
categories.
• All classes inherit information from the upper classes.
• Each derived class inherits the attributes of its base class and
this process is known as inheritance.
• In general, low level classes (known as subclasses or derived
classes) inherit state and behaviour from their high level class
(known as a super class or base class).

BiT, O-O Software Engineering


,Compiled by Samuel.A
Cont’d

BiT, O-O Software Engineering


,Compiled by Samuel.A
Cont’d
• A ‘method’ is the sequence of steps (or set of operations) to be
performed to fulfill the assigned task.
• For example, four methods ‘addMember’, ‘deleteMember’,
‘updateMember’, and ‘viewMember’ are implemented in
Member class.
• There may be many methods available for any task. It is the
responsibility of receiver of the message to choose an
appropriate method to complete task effectively & efficiently .

BiT, O-O Software Engineering


,Compiled by Samuel.A
Cont’d

BiT, O-O Software Engineering


,Compiled by Samuel.A

You might also like