0% found this document useful (0 votes)
28 views

Unit 3 Software Engineering

The document discusses Object Oriented Analysis and Design (OOAD). It explains the concepts of OOAD including Object Oriented Analysis, Object Oriented Design, classes, objects, inheritance, encapsulation, polymorphism. It also discusses the relationships between objects like association, aggregation and composition.

Uploaded by

yashthakare9267
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views

Unit 3 Software Engineering

The document discusses Object Oriented Analysis and Design (OOAD). It explains the concepts of OOAD including Object Oriented Analysis, Object Oriented Design, classes, objects, inheritance, encapsulation, polymorphism. It also discusses the relationships between objects like association, aggregation and composition.

Uploaded by

yashthakare9267
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

Ch.

3 Software Development with OOAD

G H Raisoni Institute of
Business Management, Jalgaon
Department of Computer Application

Master of Computer Application (MCA)


Academic Year: 2023-24
Third Semester

Course Code: B C A -CC-10

Course Name: Software Engineering

Prepared By: Prof. Manisha Rajput

1
Ch.3 Software Development with OOAD

Object-oriented analysis and design (OOAD)


Object-oriented analysis and design (OOAD) is a technical
approach for analyzing and designing an application, system, or
business by applying object-oriented programming, as well as
using visual modeling throughout the software development
process to guide stakeholder communication and product
quality.

OOAD in modern software engineering is typically conducted in


an iterative and incremental way. The outputs of OOAD
activities are analysis models (for OOA) and design models (for
OOD) respectively. The intention is for these to be continuously
refined and evolved, driven by key factors like risks and
business value.

Object-Oriented Analysis (OOA): Object-Oriented Analysis


(OOA) is the first technical activity performed as part of object-
oriented software engineering. OOA introduces new concepts
to investigate a problem. It is based on a set of basic principles,
which are as follows-

1. The information domain is modeled.


2. Behavior is represented.
3. The function is described.
4. Data, functional, and behavioral models are divided to
uncover greater detail.

2
Ch.3 Software Development with OOAD
5. Early models represent the essence of the problem, while
later ones provide implementation details.
The above-noted principles form the foundation for the OOA
approach.

Object-Oriented Design (OOD): An analysis model created


using object-oriented analysis is transformed by object-oriented
design into a design model that works as a plan for software
creation. OOD results in a design having several different levels
of modularity i.e., The major system components are partitioned
into subsystems (a system-level “modular”), and data
manipulation operations are encapsulated into objects (a modular
form that is the building block of an OO system.). In addition,
OOD must specify some data organization of attributes and a
procedural description of each operation. Shows a design
pyramid for object-oriented systems. It is having the following
four layers.

3
Ch.3 Software Development with OOAD

1. The Subsystem Layer: It represents the subsystem that


enables software to achieve user requirements and implement
technical frameworks that meet user needs.
2. The Class and Object Layer: It represents the class
hierarchies that enable the system to develop using
generalization and specialization. This layer also represents
each object.
3. The Message Layer: It represents the design details that
enable each object to communicate with its partners. It
establishes internal and external interfaces for the system.
4. The Responsibilities Layer: It represents the data structure
and algorithmic design for all the attributes and operations
for each object.
The Object-Oriented design pyramid specifically emphasizes
specific product or system design. Note, however, that another
design layer exists, which forms the base on which the pyramid
rests. It focuses on the core layer the design of the domain object,
which plays an important role in building the

4
Ch.3 Software Development with OOAD

infrastructure for the Object-Oriented system by providing


support for human/computer interface activities, task
management.
Some of the terminologies that are often encountered while
studying Object-Oriented Concepts include:

1. Attributes: a collection of data values that describe a class.


2. Class: encapsulates the data and procedural abstractions
required to describe the content and behaviour of some real world
entity. In other words, A class is a generalized description that
describes the collection of similar objects.
3. Objects : instances of a specific class. Objects inherit a class’s
attributes and operations.
4. Operations: also called methods and services, provide a
representation of one of the behavior of class.
5. Subclass: a specialization of the super class. A subclass can
inherit both attributes and operations from a super class.
6. Superclass: also called a base class, is a generalization of a
set of classes that are related to it.
In the object-oriented design method, the system is viewed
as a collection of objects (i.e., entities). The state is distributed
among the objects, and each object handles its state data. For
example, in a Library Automation Software, each library
representative may be a separate object with its data and functions
to operate on these data. The tasks defined for one purpose cannot
refer or change data of other objects. Objects have their internal
data which represent their state. Similar objects create a class. In
other words, each object is a member ofsome class. Classes may
inherit features from the superclass.

5
Ch.3 Software Development with OOAD

The different terms related to object design are:

1. Objects: All entities involved in the solution design are


known as objects. For example, person, banks, company,
and users are considered as objects. Every entity has some
attributes associated with it and has some methods to
perform on the attributes.
2. Classes: A class is a generalized description of an object. An
object is an instance of a class. A class defines all the
attributes, which an object can have and methods, which
represents the functionality of the object.
3. Messages: Objects communicate by message passing.
Messages consist of the integrity of the target object, the
name of the requested operation, and any other action needed
to perform the function. Messages are often implemented as
procedure or function calls.
4. Abstraction In object-oriented design, complexity is
handled using abstraction. Abstraction is the removal of the
irrelevant and the amplification of the essentials.
5. Encapsulation: Encapsulation is also called an information
hiding concept. The data and operations are linked to a single
unit. Encapsulation not only bundles essentialinformation of
an object together but also restricts access tothe data and
methods from the outside world.

6
Ch.3 Software Development with OOAD

6. Inheritance: OOD allows similar classes to stack up in a


hierarchical manner where the lower or sub-classes can
import, implement, and re-use allowed variables and
functions from their immediate superclasses. This property
of OOD is called an inheritance. This makes it easier to
define a specific class and to create generalized classesfrom
specific ones.
7. Polymorphism: OOD languages provide a mechanism
where methods performing similar tasks but vary in
arguments, can be assigned the same name. This is known as
polymorphism, which allows a single interface is performing
functions for different types. Depending upon how the
service is invoked, the respective portion of the code gets
executed.

Link
 It can be understood as the physical connection between
objects.
 It helps tell about the relationship among objects.
 It is represented using line segment between objects.
 They can’t be referenced.
 It is used in UML designs
Note:( UML (Unified Modeling Language) is a general-
purpose, graphical modeling language in the field of
Software Engineering. UML is used to specify, visualize,
construct, and document the artifacts (major elements) of the
software system)

7
Ch.3 Software Development with OOAD

Association
Association relationship is a structural relationship in which
different objects are linked within the system. It exhibits a binary
relationship between the objects representing an activity. It
depicts the relationship between objects, such as a teacher, canbe
associated with multiple teachers.
It is represented by a line between the classes followed by an
arrow that navigates the direction, and when the arrow is on both
sides, it is then called a bidirectional association. We can specify
the multiplicity of an association by adding the adornments on the
line that will denote the association.

Aggregation
Aggregation is a subset of association, is a collection of different
things. It represents has a relationship. It is more specific than an

8
Ch.3 Software Development with OOAD

association. It describes a part-whole or part-of relationship. It is


a binary association, i.e., it only involves two classes. It is a kind
of relationship in which the child is independent of its parent.
Example: Here we are considering a car and a wheel
example. A car cannot move without a wheel. But the wheel can
be independently used with the bike, scooter, cycle, or any other
vehicle. The wheel object can exist without the car object, which
proves to be an aggregation relationship.

Composition
The composition is a part of aggregation, and it portrays the
whole-part relationship. It depicts dependency between a
composite (parent) and its parts (children), which means that if
the composite is discarded, so will its parts get deleted. It exists
between similar objects.
As you can see from the example given below, the composition
association relationship connects the Person class with Brain
class, Heart class, and Legs class. If the person is destroyed, the
brain, heart, and legs will also get discarded.

9
Ch.3 Software Development with OOAD

Association Aggregation Composition

Association relationship is Aggregation relationship is The composition relationship is


represented using an represented by a straight line represented by a straight line with
arrow. with an empty diamond at one a black diamond at one end.
end.

In UML, it can exist It is a part of the association It is a part of the aggregation


between two or more relationship. relationship.
classes.

It incorporates one-to-one, It exhibits a kind of weak It exhibits a strong type of


one-to-many, many- to- relationship. relationship.
one, and many-to- many
association between the
classes.

It can associate one more In an aggregation relationship, In a composition relationship, the


objects together. the associated objects exist associated objects cannot exist
independently within the scope independently within the scope of
of the system. the system.

In this, objects are linked In this, the linked objects are Here the linked objects are
together. independent of each other. dependent on each other.

It may or may not affect Deleting one element in the It affects the other element if one

9
Ch.3 Software Development with OOAD

the other associated aggregation relationship does of its associated element is


element if one element is not affect other associated deleted.
deleted. elements.

Example: A tutor can Example: A car needs a wheel Example: If a file is placed in a
associate with multiple for its proper functioning, but it folder and that is folder is deleted.
students, or one student may not require the same The file residing insidethat folder
can associate with wheel. It may function with will also get deleted atthe time of
multiple teachers. another wheel as well. folder deletion.
Association vs. Aggregation vs. Composition
The composition and aggregation are two subsets of association.
In both of the cases, the object of one class is owned by the object
of another class; the only difference is that in composition, the
child does not exist independently of its parent, whereas in
aggregation, the child is not dependent on its parent i.e.,
standalone. An aggregation is a special form of association, and
composition is the special form of aggregation.

OOP(Object Oriented Programming)


We live in a world where we find software and programming
everywhere. The modern-day programming languages are
strongly built on the Object-Oriented Programming.

10
Ch.3 Software Development with OOAD

OOP is a paradigm that helps programmers structure their code


so that they are easy to maintain, understand, and override. The
four pillars of the OOP paradigm are Abstraction,
Encapsulation, Inheritance and Polymorphism. Now, instead
of me bragging more about OOPs, let us start with Inheritance.

What is Inheritance?
The term 'Inheritance' is derived from the word "Inherit" which
means, "to derive any quality, features or characteristics from
family". Therefore,
"Inheritance is defined as a mechanism where the sub or
child class inherits the properties and characteristics of the
super class or other derived classes. It also supports additional
features of extracting properties from the child class and using
it into other derived classes."
In computer programming, Inheritance is one of the most
important concepts followed by Abstraction, Encapsulation and
Polymorphism in the Object Oriented Programming (OOPS)
Paradigm. This mechanism allows the new objects to take on the
properties of existing objects. Inheritance builds relationships
within the classes; therefore, relating two or more classes toeach
other and establishing class hierarchies. Rather than writingthe
same code, again and again, the programmers can use the code
that is already created by inheriting its class.

Types of Inheritance:
Different Types of Inheritance
11
Ch.3 Software Development with OOAD

 Single inheritance.
 Multi-level inheritance.
 Multiple inheritance.
 Multipath inheritance.
 Hierarchical Inheritance.
 Hybrid Inheritance.

1. Single Inheritance
In this type, the child class inherits the properties from the
superclass.
In the below example, you will notice class One is the superclass,
and class Two is the base class. Therefore, class Twoinherits the
properties and behaviour of the base class One.

2. Multiple Inheritances:

12
Ch.3 Software Development with OOAD

The child class inherits the properties and features from two or
more parent classes with this type.
In the below example, you will notice class Three inherits the
features and behaviour of class Two. Further, class Two inherits
the properties of class One. Therefore, we can conclude that class
One is the base class of class Two, whereas class Two is the base
class of class Three.
Hence, class Three implicitly inherits the behaviour andproperties
of class One along with class Two, thereby creating a multiple
inheritance.

3. Multilevel Inheritance:

13
Ch.3 Software Development with OOAD

With this type, one child class inherits the properties and behavior
from two or more superclasses.
In the below example, class three inherits the properties,
functions and objects for both class Two and class One at the
same level. Therefore, both class One and class Two are the
superclasses for class Three.
4. Hierarchal Inheritance:

In the Hierarchical Inheritance type, two or more child classes


inherit the properties and behaviors from one superclass.
In the below example, the following hierarchies:
(I) The base class One has two derived classes, i.e., class Two
and class Three.
(II) Next, class Two acts as a base class for two child classes
named Six and Seven.
(III) Further, class three is also a base class for class Four and
class Five, respectively.
14
Ch.3 Software Development with OOAD

5. Hybrid Inheritance:

With this type, the programmer can call a combination of two or


more types of inheritance. Therefore the code can include a
combination of Multiple and Hierarchical inheritance, Multilevel
and Hierarchical inheritance or Hierarchical and Multipath
inheritance, or it may be a combination of three of them, i.e.,
Multiple, Multilevel and Multiple Hierarchicalinheritance.

Advantages of Inheritance
Given below are some advantages of Inheritance.
 Recursive code is written once. Therefore, allowing code
reusability.
 One base class can be used for one or more derived classes
in a hierarchy.

15
Ch.3 Software Development with OOAD

 It saves time, as the programmer does not change the value


in all the base classes; they change it in a parent class, and
the base class inherits the change.
 OOPs Inheritance is used to create dominant objects.
 Inheritance prevents data duplicity and redundancy.
 Inheritance reduces space and time complexity.
What is the Need for Inheritance?
1. Inheritance helps to prevent the rewriting of the same code
again and again. The programmer can reuse the previously
written code, override code (if necessary) and use it further
in the program.
2. OOPs Inheritance mechanism helps to prevent code
duplicity and data redundancy.
3. It also reduces the space and time complexity. Thus,
making the program more efficient.
4. Inheritance makes the program accessible, as it involves a
hierarchical programming paradigm.
5. The programmer can create any variable once and use the
same variable multiple times within the scope of the code.
6. Programmers need Inheritance to create dominant data
objects and program functions.

16

You might also like