Unit 3 Software Engineering
Unit 3 Software Engineering
G H Raisoni Institute of
Business Management, Jalgaon
Department of Computer Application
1
Ch.3 Software Development with OOAD
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.
3
Ch.3 Software Development with OOAD
4
Ch.3 Software Development with OOAD
5
Ch.3 Software Development with OOAD
6
Ch.3 Software Development with OOAD
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
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
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
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.
10
Ch.3 Software Development with OOAD
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:
5. Hybrid Inheritance:
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
16