0% found this document useful (0 votes)
73 views9 pages

Object-Oriented Software Engineering

Object-Oriented Software Engineering (OOSE) is a software design methodology developed by Ivar Jacobson in 1992 that utilizes use cases for software design and is a precursor to UML. The methodology consists of three main phases: object-oriented analysis, design, and implementation, focusing on real-world object modeling and system architecture. Key concepts include encapsulation, inheritance, polymorphism, and reusability, which enhance software modularity and maintainability.

Uploaded by

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

Object-Oriented Software Engineering

Object-Oriented Software Engineering (OOSE) is a software design methodology developed by Ivar Jacobson in 1992 that utilizes use cases for software design and is a precursor to UML. The methodology consists of three main phases: object-oriented analysis, design, and implementation, focusing on real-world object modeling and system architecture. Key concepts include encapsulation, inheritance, polymorphism, and reusability, which enhance software modularity and maintainability.

Uploaded by

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

Object-Oriented Software Engineering (OOSE) is a software design technique that is used in

software design in object-oriented programming. OOSE is developed by Ivar Jacobson in


1992. OOSE is the first object-oriented design methodology that employs use cases in software
design. OOSE is one of the precursors of the Unified Modeling Language (UML).

Phases in Object-Oriented Software Development

The major phases of software development using object–oriented methodology are object-
oriented analysis, object-oriented design, and object-oriented implementation.

 Object–Oriented Analysis

In this stage, the problem is formulated, user requirements are identified, and then a model is
built based upon real–world objects. The analysis produces models on how the desired system
should function and how it must be developed. The models do not include any implementation
details so that it can be understood and examined by any non–technical application expert.
Object–Oriented Analysis (OOA) is the procedure of identifying software engineering
requirements and developing software specifications in terms of a software system’s object
model, which comprises of interacting objects.
The main difference between object-oriented analysis and other forms of analysis is that in
object-oriented approach, requirements are organized around objects, which integrate both data
and functions. They are modelled after real-world objects that the system interacts with. In
traditional analysis methodologies, the two aspects - functions and data - are considered
separately.
Grady Booch has defined OOA as, “Object-oriented analysis is a method of analysis that
examines requirements from the perspective of the classes and objects found in the vocabulary
of the problem domain”.
The primary tasks in object-oriented analysis (OOA) are −

 Identifying objects
 Organizing the objects by creating object model diagram
 Defining the internals of the objects, or object attributes
 Defining the behavior of the objects, i.e., object actions
 Describing how the objects interact
The common models used in OOA are use cases and object models.

 Object–Oriented Design

Object-oriented design includes two main stages, namely, system design and object design.
System Design
In this stage, the complete architecture of the desired system is designed. The system is
conceived as a set of interacting subsystems that in turn is composed of a hierarchy of
interacting objects, grouped into classes. System design is done according to both the system
analysis model and the proposed system architecture. Here, the emphasis is on the objects
comprising the system rather than the processes in the system.
Object Design
In this phase, a design model is developed based on both the models developed in the system
analysis phase and the architecture designed in the system design phase. All the classes
required are identified. The designer decides whether −

 new classes are to be created from scratch,


 any existing classes can be used in their original form, or
 new classes should be inherited from the existing classes.
The associations between the identified classes are established and the hierarchies of classes
are identified. Besides, the developer designs the internal details of the classes and their
associations, i.e., the data structure for each attribute and the algorithms for the operations.
Object–Oriented Design (OOD) involves implementation of the conceptual model produced
during object-oriented analysis. In OOD, concepts in the analysis model, which are
technology−independent, are mapped onto implementing classes, constraints are identified and
interfaces are designed, resulting in a model for the solution domain, i.e., a detailed description
of how the system is to be built on concrete technologies.
The implementation details generally include −

 Restructuring the class data (if necessary),


 Implementation of methods, i.e., internal data structures and algorithms,
 Implementation of control, and
 Implementation of associations.
Grady Booch has defined object-oriented design as “a method of design encompassing the
process of object-oriented decomposition and a notation for depicting both logical and
physical as well as static and dynamic models of the system under design”.

 Object–Oriented Implementation and Testing

In this stage, the design model developed in the object design is translated into code in an
appropriate programming language or software tool. The databases are created and the specific
hardware requirements are ascertained. Once the code is in shape, it is tested using specialized
techniques to identify and remove the errors in the code.

Object

An object is a real-world element in an object–oriented environment that may have a physical


or a conceptual existence. Each object has −
 Identity that distinguishes it from other objects in the system.
 State that determines the characteristic properties of an object as well as the values of
the properties that the object holds.
 Behavior that represents externally visible activities performed by an object in terms of
changes in its state.
An object may have a physical existence, like a customer, a car, etc.; or an intangible
conceptual existence, like a project, a process, etc.

Class

A class represents a collection of objects having same characteristic properties that exhibit
common behavior. It gives the blueprint or description of the objects that can be created from
it. Creation of an object as a member of a class is called instantiation. Thus, object is an
instance of a class.
The constituents of a class are −
 A set of attributes for the objects that are to be instantiated from the class. Generally,
different objects of a class have some difference in the values of the attributes.
Attributes are often referred as class data.
 A set of operations that portray the behavior of the objects of the class. Operations are
also referred as functions or methods.
Example
Let us consider a simple class, Circle, that represents the geometrical figure circle in a two–
dimensional space. The attributes of this class can be identified as follows −

 x–coord, to denote x–coordinate of the center


 y–coord, to denote y–coordinate of the center
 a, to denote the radius of the circle
Some of its operations can be defined as follows −

 findArea(), method to calculate area


 findCircumference(), method to calculate circumference
 scale(), method to increase or decrease the radius
During instantiation, values are assigned for at least some of the attributes. If we create an
object my_circle, we can assign values like x-coord : 2, y-coord : 3, and a : 4 to depict its state.
Now, if the operation scale() is performed on my_circle with a scaling factor of 2, the value of
the variable a will become 8. This operation brings a change in the state of my_circle, i.e., the
object has exhibited certain behavior.
Each object is said to be an instance of a particular class (for example, an object with its name
field set to "Mary" might be an instance of class Employee). Procedures in object-oriented
programming are known as methods; variables are also known as fields, members, attributes, or
properties. This leads to the following terms:

 Class variables – belong to the class as a whole; there is only one copy of each one
 Instance variables or attributes – data that belongs to individual objects; every object has
its own copy of each one
 Member variables – refers to both the class and instance variables that are defined by a
particular class
 Class methods – belong to the class as a whole and have access only to class variables and
inputs from the procedure call
 Instance methods – belong to individual objects, and have access to instance variables for
the specific object they are called on, inputs, and class variables

Instance Variable
In object-oriented programming with classes, an instance variable is a variable defined in a
class (i.e. a member variable), for which each instantiated object of the class has a separate
copy, or instance. An instance variable is a variable which is declared in a class but outside the
constructor and the method/function. Instance variables are created when an object is
instantiated, and are accessible to all the methods, the constructor and block in the class. Access
modifiers can be given to the instance variable.
An instance variable is not a class variable although there are similarities. It is a type of class
attribute (or class property, field, or data member). The same dichotomy
between instance and class members applies to methods ("member functions") as well; a class
may have both instance methods and class methods.
Each instance variable lives in memory for the life of the object it is owned by.
Variables are properties an object knows about itself. All instances of an object have their own
copies of instance variables, even if the value is the same from one object to another. One
object instance can change values of its instance variables without affecting all other instances.
Instance variables can be used by all methods of a class unless the method is declared as static.
Object Composition
Objects can contain other objects in their instance variables; this is known as object
composition. For example, an object in the Employee class might contain (either directly or
through a pointer) an object in the Address class, in addition to its own instance variables like
"first_name" and "position". Object composition is used to represent "has-a" relationships:
every employee has an address, so every Employee object has access to a place to store an
Address object (either directly embedded within itself, or at a separate location addressed via a
pointer).
Abstract Classes
A class that is declared using “abstract” keyword is known as abstract class. It can have
abstract methods(methods without body) as well as concrete methods (regular methods with
body). A normal class(non-abstract class) cannot have abstract methods. Abstract
classes cannot be instantiated into objects; they exist only for the purpose of inheritance into
other "concrete" classes which can be instantiated.
Lets say we have a class Animal that has a method sound() and the subclasses of it
like Dog, Lion, Horse, Cat etc. Since the animal sound differs from one animal to another,
there is no point to implement this method in parent class. This is because every child class
must override this method to give its own implementation details, like Lion class will say
“Roar” in this method and Dog class will say “Woof”.

Encapsulation

Encapsulation is the process of binding both attributes and methods together within a class.
Through encapsulation, the 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.

Modularity

Modularity is the process of decomposing a problem (program) into a set of modules so as to


reduce the overall complexity of the problem. “Modularity is the property of a system that has
been decomposed into a set of cohesive and loosely coupled modules.” Modularity is
intrinsically linked with encapsulation. Modularity can be visualized as a way of mapping
encapsulated abstractions into real, physical modules having high cohesion within the modules
and their inter–module interaction or coupling is low.
Data Hiding
Typically, a class is designed such that its data (attributes) can be accessed only by its class
methods and insulated from direct outside access. This process of insulating an object’s data is
called data hiding or information hiding.

Example
In the class Circle, data hiding can be incorporated by making attributes invisible from outside
the class and adding two more methods to the class for accessing class data, namely −

 setValues(), method to assign values to x-coord, y-coord, and a


 getValues(), method to retrieve values of x-coord, y-coord, and a
Here the private data of the object my_circle cannot be accessed directly by any method that is
not encapsulated within the class Circle. It should instead be accessed through the methods
setValues() and getValues().
Data Abstraction
Abstraction refers to the act of representing important and special features without including the
background details or explanation about that feature. Data abstraction simplifies database
design.

1. Physical Level: It describes how the records are stored, which are often hidden from the
user. It can be described with the phrase, “block of storage.”
2. Logical Level: It describes data stored in the database and the relationships between the
data. The programmers generally work at this level as they are aware of the functions
needed to maintain the relationships between the data.
3. View Level: Application programs hide details of data types and information for security
purposes. This level is generally implemented with the help of GUI, and details that are
meant for the user are shown.

Message Passing

Any application requires a number of objects interacting in a harmonious manner. Objects in a


system may communicate with each other using message passing. Suppose a system has two
objects: obj1 and obj2. The object obj1 sends a message to object obj2, if obj1 wants obj2 to
execute one of its methods.

The features of message passing are −

 Message passing between two objects is generally unidirectional.


 Message passing enables all interactions between objects.
 Message passing essentially involves invoking class methods.
 Objects in different processes can be involved in message passing.

Inheritance: Inheritance is the mechanism that permits new classes to be created out of existing
classes by extending and refining its capabilities. The existing classes are called the base
classes/parent classes/super-classes, and the new classes are called the derived classes/child
classes/subclasses. The subclass can inherit or derive the attributes and methods of the super-
class(es) provided that the super-class allows so. Besides, the subclass may add its own
attributes and methods and may modify any of the super-class methods. Inheritance defines an
“is – a” relationship.

Example: From a class Mammal, a number of classes can be derived such as Human, Cat,
Dog, Cow, etc. Humans, cats, dogs, and cows all have the distinct characteristics of mammals.
In addition, each has its own particular characteristics. It can be said that a cow “is – a”
mammal.

Types of Inheritance

 Single Inheritance − A subclass derives from a single super-class.


 Multiple Inheritance − A subclass derives from more than one super-classes.
 Multilevel Inheritance − A subclass derives from a super-class which in turn is
derived from another class and so on.
 Hierarchical Inheritance − A class has a number of subclasses each of which may
have subsequent subclasses, continuing for a number of levels, so as to form a tree
structure.
 Hybrid Inheritance − A combination of multiple and multilevel inheritance so as to
form a lattice structure.
Reusability

Reusability is the use of existing assets in some form within the software product development
process. Assets are products and by products of the software development life cycle and include
code, software components, test suites, designs and documentation. A chunk of code is
regularly organized using modules or namespaces into layers. Objects and software components
offer a more advanced form of reusability.

Extensibility

Extensibility is a system design principle where the implementation takes future growth into
consideration. It is a systemic measure of the ability to extend a system and the level of effort
required to implement the extension. Extensions can be through the addition of new
functionality or through modification of existing functionality. The central theme is to provide
for change typically enhancements while minimizing impact to existing system functions.
Polymorphism: Polymorphism means the ability to take multiple forms. In object-oriented
paradigm, polymorphism implies using operations in different ways, depending upon the
instance they are operating upon. Polymorphism allows objects with different internal structures
to have a common external interface. Polymorphism is particularly effective while
implementing inheritance.

Example: Let us consider two classes, Circle and Square, each with a method findArea().
Though the name and purpose of the methods in the classes are same, the internal
implementation, i.e., the procedure of calculating area is different for each class. When an
object of class Circle invokes its findArea() method, the operation finds the area of the circle
without any conflict with the findArea() method of the Square class.

Hierarchy: Hierarchy is the ranking or ordering of abstraction. Through hierarchy, a system


can be made up of interrelated subsystems, which can have their own subsystems and so on
until the smallest level components are reached. It uses the principle of “divide and conquer”.
Hierarchy allows code reusability. The two types of hierarchies are −

 “IS–A” hierarchy − It defines the hierarchical relationship in inheritance, whereby


from a super-class, a number of subclasses may be derived which may again have
subclasses and so on. For example, if we derive a class Rose from a class Flower, we
can say that a rose “is–a” flower.
 “PART–OF” hierarchy − It defines the hierarchical relationship in aggregation by
which a class may be composed of other classes. For example, a flower is composed of
sepals, petals, stamens, and carpel. It can be said that a petal is a “part–of” flower.

Generalization and Specialization: Generalization and specialization represent a hierarchy of


relationships between classes, where subclasses inherit from super-classes.

Generalization: In the generalization process, the common characteristics of classes are


combined to form a class in a higher level of hierarchy, i.e., subclasses are combined to form a
generalized super-class. It represents an “is – a – kind – of” relationship. For example, “car is a
kind of land vehicle”, or “ship is a kind of water vehicle”.

Specialization: Specialization is the reverse process of generalization. Here, the distinguishing


features of groups of objects are used to form specialized classes from existing classes. It can be
said that the subclasses are the specialized versions of the super-class.

Link: A link represents a connection through which an object collaborates with other objects.
Through a link, one object may invoke the methods or navigate through another object. A link
depicts the relationship between two or more objects.

Association: Association is a group of links having common structure and common behavior.
Association depicts the relationship between objects of one or more classes. A link can be
defined as an instance of an association.

Degree of an Association: Degree of an association denotes the number of classes involved in


a connection. Degree may be unary, binary, or ternary.

 A unary relationship connects objects of the same class.


 A binary relationship connects objects of two classes.
 A ternary relationship connects objects of three or more classes.

Cardinality Ratios of Associations: Cardinality of a binary association denotes the number of


instances participating in an association. There are three types of cardinality ratios, namely −

 One–to–One − A single object of class A is associated with a single object of class B.


 One–to–Many − A single object of class A is associated with many objects of class B.
 Many–to–Many − An object of class A may be associated with many objects of class
B and conversely an object of class B may be associated with many objects of class A.

Aggregation or Composition: Aggregation or composition is a relationship among classes by


which a class can be made up of any combination of objects of other classes. It allows objects to
be placed directly within the body of other classes. Aggregation is referred as a “part–of” or
“has–a” relationship, with the ability to navigate from the whole to its parts. An aggregate
object is an object that is composed of one or more other objects.

Example
In the relationship, “a car has–a motor”, car is the whole object or the aggregate, and the motor
is a “part–of” the car. Aggregation may denote −
 Physical containment − Example, a computer is composed of monitor, CPU, mouse,
keyboard, and so on.
 Conceptual containment − Example, shareholder has–a share.

Benefits of Object Model

The benefits of using the object model are −


 It helps in faster development of software.
 It is easy to maintain. Suppose a module develops an error, then a programmer can fix
that particular module, while the other parts of the software are still up and running.
 It supports relatively hassle-free upgrades.
 It enables reuse of objects, designs, and functions.
 It reduces development risks, particularly in integration of complex systems.

You might also like