Sie sind auf Seite 1von 25

OOSE : OBJECT ORIENTED

SOFTWARE ENGINEERING



CHAPTER 1

OBJECT ORIENTED CONCEPTS AND
PRINCIPLES
1.1 What is Object Orientation ?
Definition : Object Orientation means organizing
software as a collection of distinct objects with its state
and behavior.

1.1.1 Introduction :
In Object Orientation, everything is an object and
system should be build from collection of reusable
components called objects.

Use of Object Orientation :
It is a technique used for system modeling.

System Modeling :
It is the interdisciplinary study of the use of models to
construct the systems in business and IT
developments.


1.1.2 Object
Definition : It is a real-world entity.
It is a collection of data and logic.
e.g. If Employee is an object then ID, name,
address, etc. are data and Read, write,
compute, etc. are methods/ operations/
behavior.
Objects are communicating with each other
by sending messages/ stimuli.
Messages can be either request for
information or a request to perform an
action.

1.1.3 Classes and Instances
Class : It is the collection of objects, that
share common structure and behavior.
Kiran Manali
Sneha
Class



Instances of class


Instance : An object is Instance of class.
e.g.
Employee Class

1.1.3 Polymorphism :
Definition : Polymorphism is nothing but the
same operation may behave differently on
different classes,
Polymorphism is said to mean that one operation
can be implemented in different ways in different
classes.
e.g. Addition : of two numbers - generates sum
Addition : of two strings - concatenates two
strings

e.g. Draw : of circle - draws circle
: of rectangle - draws rectangle

Shape
draw()


Circle Rectangle Triangle

draw() draw() draw()



Two types of polymorphism :
a. Static Binding : In this type, compiler decides
which function is to be used on the basis of
parameter passed to the function.
b.Dynamic Binding : In this type, functions are
used at run time.


1.1.4 Inheritance :
It is the process of deriving new class from
existing one/old class.
Here, Old class : Base class / Super class
And New class : Derived class / Subclass
Subclass inherits all of the instance variables
and methods defined by superclass and also
adds its own elements.
Types of Inheritance :
There are 5 types : a. Single Inheritance
b. Multiple Inheritance
c. Multilevel Inheritance
d. Hierarchical Inheritance
e. Hybrid Inheritance




a. Single Inheritance : One Subclass is derived
from only one superclass.

A


B


b. Multiple Inheritance : It has several super
classes and only one subclass is derived from
them.

A B


C





















c. Multilevel Inheritance : A subclass is
derived from another subclass. i.e. it uses
subclass as a superclass.
A

B

C
d. Hierarchical Inheritance : Many classes are
derived from one superclass.

A

B C D

e. Hybrid Inheritance : It has one or more
types of inheritance.

A

B C

D

Above examples has multiple and hierarchical
inheritance.



1.2 Object Oriented System Development :
Definition : It is nothing but systematic
approach to design large and complex
systems.
In order to design a good system there are
different system development methods
E.g. Waterfall model and spiral model

1.2.1 Waterfall and Spiral Model

a. Requirement Specification : All possible
requirements are gathered and developed in
this stage and are documented for further
operations.
b. Analysis : the requirements are studied from
first phase and then logical description of
system and system design is prepared.

Requirement
specifications

Analysis


Design


Implementation
and unit testing

Integration


Maintenance

Waterfall Model
c. System Design : helps in specifying
hardware and system requirements and also
helps in defining overall system architecture.
d. Implementation and unit testing : with
inputs from system design, the system is
developed in small programs called
Units. Each unit is developed and tested for its
functionality , which are referred to as Unit
Testing.
e. Maintenance : There are some issues which
come up in the client environment. These issues
are fixed up in this phase and also to enhance
the product, some better versions are released.
Thus, maintenance is done to deliver these
changes in customer environment.
Spiral Model : The Spiral model can describe
how a product develops to form new versions,
and how a version can be incrementally
developed from prototype to complete product.
1.2.2 Function / Data Methods









Sr.no Function / Data method Object oriented Method
1. These are the methods that
treat functions and/or data as
being more or less separate.
Object oriented methods view
functions view functions and
data as highly integrated.
2. Function has high probability
to change.
Object have low probability
for change.
3. A system developed using
function and data method
often become difficult to
maintain.
Comparatively easy to
maintain.
4. Function/data systems
becomes more difficult to
modify.
Easy to modify.
1.2.3 Object-oriented analysis
Purpose : is to obtain the understanding of
application.
An understanding depending only on the
systems functional requirement.
Object-oriented analysis uses the object-
oriented techniques and contains, in some
order, the following activities :

1. Finding the object
2. Organizing the objects
3. Describing how object interacts
4. Defining the operations of the objects
5. Defining the object internally

1. Finding an Object :
The aim is to find the essential objects, which
are to remain essential throughout the systems
life cycle.
As objects are essential, they will probably
always exists and in this way we hope to obtain
a stable system.
E.g. for banking application, typical objects
would include customer, account, etc.
2. Organizing the objects:
Objects can be organize in two ways :
i. One can start classification by considering
how similar the classes of objects to each
other.
ii. Another classification can be made by
considering which object work with which
another object or how an object is a part of
another.
3. Object Interaction :
In order to obtain the picture of how the object fits
into the system , we can describe different
scenarios or use cases in which object takes part
and communicates with other object.

4. Operations on objects :
An operation on object comes naturally when we
consider an objects interface. Operations can be
primitive i.e. create, add, delete, etc. or more
complex.

5. Object Implementation :
After all above 4 techniques, finally, object should
be defined internally, which includes defining the
information that each object must hold.
From above points, we can note that all of
these steps are dependent on other steps and
that, during development, these steps are
typically worked with iteratively.
1.2.4 Object Oriented Construction
Object oriented construction means that the
analysis model is designed and implemented in
source code. And this source code is executed in
the target environment(i.e. ideal model produced
by the analysis model).


1.3 Identifying the elements of an object
model
a. Attributes : An attribute is a data value held by
object in a class. E.g. name, age, height,
weight, etc.
b. Class : It is a collection of similar objects.
c. Objects : It is an instance of a specific class.
object inherits class attributes and operations.
d. Operations : It is also called as methods and
services which provides a representation of
one of the behavior of the class.
e. Subclass : It is a specification of a superclass.
A subclass inherits both attributes and
operations of a superclass. It is also referred
as Derived class.
f. Superclass : It is also referred as Base class,
which is generalization of a set of classes that
are related to it.













1.4 Identifying classes and objects
Classes and objects are tightly interwoven
with each other.
But there is a one big difference between
them:
Object is a concrete entity that exists in time
and space.
A class represents only an abstraction, the
essence of an object.

1.5 Specifying the attributes (with visibility)
To store information, object uses attributes.
One object can have many attributes.
Each attribute has a type like int, float, string,
etc.
Attributes are used in all types of objects to
describe the information to be stored.

Guidelines defining attributes
1. Keep the class simple and states only enough
attributes to define object state .
2. Attributes are less likely to be fully described
in the problem statement.
3. Omit the derived attributes.
4. Do not carry discovery of attribute to excess.
You can add more attributes in subsequent
iterations.

Types Of Attributes
1. Single value attributes
2. Multi value attributes
3. References to another object or instance
connection.
Syntax to define class attributes :


Here, Type expression : Type of attribute
Initial Value : for the initial value of a
newly created object. It is optional.

Where visibility is one of the following :























Visibility Name : type-expression = Initial
value
Operator Visibility
Type
Description
+ Public
Visibility
Accessibility to all classes
- Private
Visibility
Accessibility only to the operations of the
class
# Protected
Visibility
Accessibility to subclasses and operators
of a class
e.g. attributes for transaction class are defined
as :
#transID : String
#transDate : Date
#FirstName : String
#LastName : String
#Amount : Float

1.6 Defining Operations
An Operation is a function or transformation
that maybe applied to or by object in a class.
It defines the behavior of an object.
Syntax :




Visibility name : (parameter_list) : return-type expression
Where, name : name of operation,
parameter_list : list of parameters, separated by
commas,
return-type expression : value to be returned by
method e.g. +get_Name() : a Name
E.g. classes with operations and visibility


Account
#number : String
#balance : Float
-
-
-
+deposit()
+withdraw()
#update_Account()


1.7 Finalizing the object definition
Object of Object-oriented Analysis : is to define
all classes and the relationships and behavior
associated with them that are relevant to the
problem to be solved.
To accomplish this, following tasks must occur :
a. Basic user requirement as must be
communicated between the customer and
software engineer.
b. Classes must be identified i.e. attributes and
methods are defined.
c. A class hierarchy is defined.
d. Object to object relationships connections must
occur.
e. Object behavior must be modeled.
f. Task a to e are reapplied iteratively until the
model is complete.


END
OF
CHAPTER 1

Das könnte Ihnen auch gefallen