Advanced Programming: OOP Concepts, Design Patterns, UML Diagrams
VerifiedAdded on 2021/05/07
|28
|9269
|140
Report
AI Summary
This report provides a comprehensive overview of advanced programming concepts, focusing on Object-Oriented Programming (OOP) principles. It explores key concepts such as encapsulation, abstraction, inheritance, and polymorphism, explaining their significance and implementation. The report also delves into the use of access modifiers (public, private, protected) and their impact on inheritance. It examines the role of constructors and destructors in object lifecycle management, as well as the relationship between abstract classes and interfaces. Furthermore, the report identifies and analyzes various class relationships (association, aggregation, composition, generalization, realization, dependency) and their application in software design. It also determines and explains design patterns from creational, structural, and behavioral pattern types. The report concludes with an analysis of the relationship between the object-oriented paradigm and design patterns and includes the use of UML diagrams for class design.

Pearson Education 2018
Higher Education Qualifications
STUDENT ASSESSMENT SUBMISSION AND DECLARATION
When submitting evidence for assessment, each student must sign a declaration confirming that
the work is their own.
Student name: Vaibhav Masaye Assessor name: Neha Jaiswar
Issue date: 14 Oct0ber
2020
Submission date: 31 December
2020
Submitted on: 31 December
2020
Programmer: Pearson BTEC Level 5 HND in Computing (Application Development)
Unit 20: Advanced Programming
Assignment number and title: 1 of 2: Advanced Programming – Part 1
Plagiarism
Plagiarism is a particular form of cheating. Plagiarism must be avoided at all costs and students
who break the rules, however innocently, may be penalized. It is your responsibility to ensure
that you understand correct referencing practices. As a university level student, you are
expected to use appropriate references throughout and keep carefully detailed notes of all your
sources of materials for material you have used in your work, including any material
downloaded from the Internet. Please consult the relevant unit lecturer or your course tutor if
you need any further advice.
Student Declaration
Student declaration
I certify that the assignment submission is entirely my own work and I fully understand the
consequences of plagiarism. I understand that making a false declaration is a form of
malpractice.
Student signature: Date: 31 December 2020
Higher Education Qualifications
STUDENT ASSESSMENT SUBMISSION AND DECLARATION
When submitting evidence for assessment, each student must sign a declaration confirming that
the work is their own.
Student name: Vaibhav Masaye Assessor name: Neha Jaiswar
Issue date: 14 Oct0ber
2020
Submission date: 31 December
2020
Submitted on: 31 December
2020
Programmer: Pearson BTEC Level 5 HND in Computing (Application Development)
Unit 20: Advanced Programming
Assignment number and title: 1 of 2: Advanced Programming – Part 1
Plagiarism
Plagiarism is a particular form of cheating. Plagiarism must be avoided at all costs and students
who break the rules, however innocently, may be penalized. It is your responsibility to ensure
that you understand correct referencing practices. As a university level student, you are
expected to use appropriate references throughout and keep carefully detailed notes of all your
sources of materials for material you have used in your work, including any material
downloaded from the Internet. Please consult the relevant unit lecturer or your course tutor if
you need any further advice.
Student Declaration
Student declaration
I certify that the assignment submission is entirely my own work and I fully understand the
consequences of plagiarism. I understand that making a false declaration is a form of
malpractice.
Student signature: Date: 31 December 2020
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

Unit 20: Advanced Programming
Vaibhav Masaye Page | 2
Contents
o Key concepts of OOP .............................................................................................................................. 3
❖ Encapsulation ....................................................................................................................................... 3
❖ Abstraction ............................................................................................................................................ 3
❖ Inheritance ............................................................................................................................................ 3
❖ Polymorphism ....................................................................................................................................... 4
o Use of public, private and protected access or keywords and their effect on
inheritance .......................................................................................................................................................... 4
o The role of constructors/destructors ............................................................................................... 5
▪ Constructors: - ..................................................................................................................................... 5
▪ Destructors: .......................................................................................................................................... 7
o The relationship between Abstract classes and interfaces ...................................................... 9
➢ Abstract classes ................................................................................................................................... 9
➢ Interfaces ............................................................................................................................................... 9
o Identify scenarios where class relationships are used ............................................................ 10
➢ Association .......................................................................................................................................... 10
➢ Aggregation ......................................................................................................................................... 11
➢ Composition ........................................................................................................................................ 11
➢ Abstraction .......................................................................................................................................... 11
➢ Generalization .................................................................................................................................... 11
➢ Realization ........................................................................................................................................... 12
➢ Dependency ........................................................................................................................................ 12
❖ Determine a design pattern from each of the creational, structural and behavioral
pattern types. .................................................................................................................................................. 13
❖ Creational design patterns ............................................................................................................ 13
❖ Structural Design Patterns ............................................................................................................ 14
❖ Behavioral Design Patterns ........................................................................................................... 15
❖ Analyze the relationship between the object-orientated paradigm and design
patterns. ............................................................................................................................................................ 17
❖ UML tool for build class diagram and Design. ............................................................................ 21
➢ What is class diagram? ................................................................................................................... 21
➢ Base on the scenario, define the classes, attributes, and methods .............................. 21
❖ Class diagrams for Various design patterns using a UML tool. ............................................ 24
Vaibhav Masaye Page | 2
Contents
o Key concepts of OOP .............................................................................................................................. 3
❖ Encapsulation ....................................................................................................................................... 3
❖ Abstraction ............................................................................................................................................ 3
❖ Inheritance ............................................................................................................................................ 3
❖ Polymorphism ....................................................................................................................................... 4
o Use of public, private and protected access or keywords and their effect on
inheritance .......................................................................................................................................................... 4
o The role of constructors/destructors ............................................................................................... 5
▪ Constructors: - ..................................................................................................................................... 5
▪ Destructors: .......................................................................................................................................... 7
o The relationship between Abstract classes and interfaces ...................................................... 9
➢ Abstract classes ................................................................................................................................... 9
➢ Interfaces ............................................................................................................................................... 9
o Identify scenarios where class relationships are used ............................................................ 10
➢ Association .......................................................................................................................................... 10
➢ Aggregation ......................................................................................................................................... 11
➢ Composition ........................................................................................................................................ 11
➢ Abstraction .......................................................................................................................................... 11
➢ Generalization .................................................................................................................................... 11
➢ Realization ........................................................................................................................................... 12
➢ Dependency ........................................................................................................................................ 12
❖ Determine a design pattern from each of the creational, structural and behavioral
pattern types. .................................................................................................................................................. 13
❖ Creational design patterns ............................................................................................................ 13
❖ Structural Design Patterns ............................................................................................................ 14
❖ Behavioral Design Patterns ........................................................................................................... 15
❖ Analyze the relationship between the object-orientated paradigm and design
patterns. ............................................................................................................................................................ 17
❖ UML tool for build class diagram and Design. ............................................................................ 21
➢ What is class diagram? ................................................................................................................... 21
➢ Base on the scenario, define the classes, attributes, and methods .............................. 21
❖ Class diagrams for Various design patterns using a UML tool. ............................................ 24

Unit 20: Advanced Programming
Vaibhav Masaye Page | 3
Examine the characteristics of the object-orientated paradigm and
the various class relationships.
o Key concepts of OOP
Object-oriented programming has four essential ideas: encapsulation,
abstraction, inheritance, and polymorphism. Regardless of whether these
ideas appear to be unbelievably perplexing, understanding the overall
structure of how they work will assist you with understanding the
fundamentals of a computer program. Here are the four essential
speculations and what they involve:
• Encapsulation
• Abstraction
• Inheritance
• Polymorphism
❖ Encapsulation
The various objects within each program will attempt to speak with one
another consequently. On the off chance that a software engineer needs
to prevent objects from connecting with one another, they should be
exemplified in individual classes. Through the cycle of encapsulation,
classes can't change or connect with the particular factors and elements
of an object.
Much the same as a pill "encapsulates" or contains the prescription within
its covering, the guideline of encapsulation works in an advanced manner
to frame a defensive boundary around the data that isolates it from the
remainder of the code. Developers can repeat this object all through
various pieces of the program or different projects.
❖ Abstraction
Abstraction resembles an expansion of encapsulation since it conceals
certain properties and techniques from the external code to make the
interface of the objects less complex. Software engineers use abstraction
for a few valuable reasons. By and large, abstraction confines the effect of
changes made to the code so that if something turns out badly, the
change will just influence the factors that appeared and not the external
code.
❖ Inheritance
Utilizing this idea, software engineers can expand the usefulness of the
code's current classes to dispense with redundant code. For example,
components of HTML code that incorporate a content box, select field, and
checkbox share certain properties practically speaking with explicit
strategies.
Vaibhav Masaye Page | 3
Examine the characteristics of the object-orientated paradigm and
the various class relationships.
o Key concepts of OOP
Object-oriented programming has four essential ideas: encapsulation,
abstraction, inheritance, and polymorphism. Regardless of whether these
ideas appear to be unbelievably perplexing, understanding the overall
structure of how they work will assist you with understanding the
fundamentals of a computer program. Here are the four essential
speculations and what they involve:
• Encapsulation
• Abstraction
• Inheritance
• Polymorphism
❖ Encapsulation
The various objects within each program will attempt to speak with one
another consequently. On the off chance that a software engineer needs
to prevent objects from connecting with one another, they should be
exemplified in individual classes. Through the cycle of encapsulation,
classes can't change or connect with the particular factors and elements
of an object.
Much the same as a pill "encapsulates" or contains the prescription within
its covering, the guideline of encapsulation works in an advanced manner
to frame a defensive boundary around the data that isolates it from the
remainder of the code. Developers can repeat this object all through
various pieces of the program or different projects.
❖ Abstraction
Abstraction resembles an expansion of encapsulation since it conceals
certain properties and techniques from the external code to make the
interface of the objects less complex. Software engineers use abstraction
for a few valuable reasons. By and large, abstraction confines the effect of
changes made to the code so that if something turns out badly, the
change will just influence the factors that appeared and not the external
code.
❖ Inheritance
Utilizing this idea, software engineers can expand the usefulness of the
code's current classes to dispense with redundant code. For example,
components of HTML code that incorporate a content box, select field, and
checkbox share certain properties practically speaking with explicit
strategies.
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

Unit 20: Advanced Programming
Vaibhav Masaye Page | 4
Rather than reclassifying the properties and strategies for each sort of
HTML component, you can characterize them once in a conventional
object. Naming that object something like "HTML Element" will make
different objects acquire their properties and strategies so you can
decrease pointless code.
The primary object is the superclass and all objects that follow it are
subclasses. Subclasses can have separate components while adding what
they need from the superclass.
❖ Polymorphism
This strategy signifying "numerous structures or shapes" permits
developers to deliver various HTML components relying upon the sort of
object. This idea permits developers to reclassify the manner in which
something works by changing how it is done or by changing the parts in
which it is finished. Terms of polymorphism are called superseding and
over-burdening.
o Use of public, private and protected access or keywords and their
effect on inheritance
There are two sorts of modifiers in the Object-orientated worldview:
access modifiers and non-access modifiers.
The access modifiers in the Object-orientated worldview indicates the
accessibility or extent of a field, strategy, constructor, or class. We can
change the access level of fields, constructors, methods, and classes by
applying the access modifier to it.
There are four kinds of Object-orientated worldview access modifiers:
1. Private: The access level of a private modifier is just inside the class. It
can't be accessed from outside the class.
2. Default: The access level of a default modifier is just inside the bundle. It
can't be accessed from outside the bundle. On the off chance that you
don't indicate any access level, it will be the default.
3. Protected: The access level of a protected modifier is inside the bundle
and outside the bundle through the child class. On the off chance that you
don't make the kid class, it can't be accessed from outside the bundle.
4. Public: The access level of a public modifier is all over. It very well may be
accessed from inside the class, outside the class, inside the bundle, and
outside the bundle.
Vaibhav Masaye Page | 4
Rather than reclassifying the properties and strategies for each sort of
HTML component, you can characterize them once in a conventional
object. Naming that object something like "HTML Element" will make
different objects acquire their properties and strategies so you can
decrease pointless code.
The primary object is the superclass and all objects that follow it are
subclasses. Subclasses can have separate components while adding what
they need from the superclass.
❖ Polymorphism
This strategy signifying "numerous structures or shapes" permits
developers to deliver various HTML components relying upon the sort of
object. This idea permits developers to reclassify the manner in which
something works by changing how it is done or by changing the parts in
which it is finished. Terms of polymorphism are called superseding and
over-burdening.
o Use of public, private and protected access or keywords and their
effect on inheritance
There are two sorts of modifiers in the Object-orientated worldview:
access modifiers and non-access modifiers.
The access modifiers in the Object-orientated worldview indicates the
accessibility or extent of a field, strategy, constructor, or class. We can
change the access level of fields, constructors, methods, and classes by
applying the access modifier to it.
There are four kinds of Object-orientated worldview access modifiers:
1. Private: The access level of a private modifier is just inside the class. It
can't be accessed from outside the class.
2. Default: The access level of a default modifier is just inside the bundle. It
can't be accessed from outside the bundle. On the off chance that you
don't indicate any access level, it will be the default.
3. Protected: The access level of a protected modifier is inside the bundle
and outside the bundle through the child class. On the off chance that you
don't make the kid class, it can't be accessed from outside the bundle.
4. Public: The access level of a public modifier is all over. It very well may be
accessed from inside the class, outside the class, inside the bundle, and
outside the bundle.
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

Unit 20: Advanced Programming
Vaibhav Masaye Page | 5
There are many non-access modifiers, such as static, abstract,
synchronized, native, volatile, transient, etc. Here, we are going to learn the
access modifiers only.
Access
Modifier
Package Subclass Subclass
(same
package)
Outside
(different
package)
World
public Yes Yes Yes Yes Yes
protected Yes Yes Yes Yes No
default Yes Yes Yes No No
private Yes No No No No
o The role of constructors/destructors
▪ Constructors: -
A constructor is special member function whose task is to
initialize all the private data members of the object. It is a special
member function because its name is same as class name.
Constructor is invoked whenever an object of its associated, class
is created. It is called as constructor because it constructs the
values of data member of object. The constructor is declared and
defined is as follows.
Class ABC
{
int a,b;
Public:
ABC ()
{…
…
}
};
Vaibhav Masaye Page | 5
There are many non-access modifiers, such as static, abstract,
synchronized, native, volatile, transient, etc. Here, we are going to learn the
access modifiers only.
Access
Modifier
Package Subclass Subclass
(same
package)
Outside
(different
package)
World
public Yes Yes Yes Yes Yes
protected Yes Yes Yes Yes No
default Yes Yes Yes No No
private Yes No No No No
o The role of constructors/destructors
▪ Constructors: -
A constructor is special member function whose task is to
initialize all the private data members of the object. It is a special
member function because its name is same as class name.
Constructor is invoked whenever an object of its associated, class
is created. It is called as constructor because it constructs the
values of data member of object. The constructor is declared and
defined is as follows.
Class ABC
{
int a,b;
Public:
ABC ()
{…
…
}
};

Unit 20: Advanced Programming
Vaibhav Masaye Page | 6
The information individuals from an object made by class will be
instated consequently.
for example
main ( )
{ ABC A1;
}
This assertion makes object A1 as well as introduce its
information individuals an and b to
There is no compelling reason to compose any assertion to
summon constructor. A constructor that acknowledges no
boundaries is called a "Default constructor" accordingly, the
assertion ABC A1 conjures the default constructor.
S. No Constructor Function
1. The name of constructor is
same as the name of class.
The name of function is
different from the name of
class.
2. They are invoked
automatically, when the
objects are created
They are called, after the
objects are created
3. They cannot return values.
They DONOT have return
data types.
Function return a value
4. They must be declared in
the public section.
They can be declared in the
public, private or protected
section.
Construct
or
has same
name as
name of
the class
is invoked
automatically
when
object is
created
is used to
initialize
an object
when it is
created
does not
return any
value
should be
declared in
public section
only
Vaibhav Masaye Page | 6
The information individuals from an object made by class will be
instated consequently.
for example
main ( )
{ ABC A1;
}
This assertion makes object A1 as well as introduce its
information individuals an and b to
There is no compelling reason to compose any assertion to
summon constructor. A constructor that acknowledges no
boundaries is called a "Default constructor" accordingly, the
assertion ABC A1 conjures the default constructor.
S. No Constructor Function
1. The name of constructor is
same as the name of class.
The name of function is
different from the name of
class.
2. They are invoked
automatically, when the
objects are created
They are called, after the
objects are created
3. They cannot return values.
They DONOT have return
data types.
Function return a value
4. They must be declared in
the public section.
They can be declared in the
public, private or protected
section.
Construct
or
has same
name as
name of
the class
is invoked
automatically
when
object is
created
is used to
initialize
an object
when it is
created
does not
return any
value
should be
declared in
public section
only
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

Unit 20: Advanced Programming
Vaibhav Masaye Page | 7
5. Generally, constructor is used
for initialization purpose
Function are used for
calculation and initialization
purpose.
6. Class demo
{
demo ()
{---------}
};
Class Demo
{
void
getData()
{------------}
int
calculate()
{------------}
};
Attributes of constructor
1. It should be announced in the public segment.
2. They are conjured naturally when the objects are made.
3. They don't have a return information type for example they can't
restore any worth.
4. They can't have inheritance property
5. Like other C++ capacities they can have default contentions.
6. Constructors can't allude to their location.
7. An object with a constructor can't be utilized as an individual from
'association'.
They settle on the understood decision to administrator new and Delete
when memory assignment is required.
There are different types of Constructors:
1. Default Constructor
2. Parameterized constructor
3. Copy constructor
4. Default Value constructor
5. Dynamic Constructor
▪ Destructors: -
Destructors are generally used to deallocate memory and do
another cleanup for a class object and its class individuals when
the object is annihilated. A destructor is required a class object
when that object drops of degree or is expressly erased.
The destructors as the name suggests are utilized to annihilate
the object that has been made by the constructors. Like the
constructor, the destructor is a part of work whose name is
Vaibhav Masaye Page | 7
5. Generally, constructor is used
for initialization purpose
Function are used for
calculation and initialization
purpose.
6. Class demo
{
demo ()
{---------}
};
Class Demo
{
void
getData()
{------------}
int
calculate()
{------------}
};
Attributes of constructor
1. It should be announced in the public segment.
2. They are conjured naturally when the objects are made.
3. They don't have a return information type for example they can't
restore any worth.
4. They can't have inheritance property
5. Like other C++ capacities they can have default contentions.
6. Constructors can't allude to their location.
7. An object with a constructor can't be utilized as an individual from
'association'.
They settle on the understood decision to administrator new and Delete
when memory assignment is required.
There are different types of Constructors:
1. Default Constructor
2. Parameterized constructor
3. Copy constructor
4. Default Value constructor
5. Dynamic Constructor
▪ Destructors: -
Destructors are generally used to deallocate memory and do
another cleanup for a class object and its class individuals when
the object is annihilated. A destructor is required a class object
when that object drops of degree or is expressly erased.
The destructors as the name suggests are utilized to annihilate
the object that has been made by the constructors. Like the
constructor, the destructor is a part of work whose name is
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

Unit 20: Advanced Programming
Vaibhav Masaye Page | 8
equivalent to the class name however went before by a tilde (~)
sign.
Example: the destructor for class ABC is given as;
Class ABC
{
public:
ABC (); //Constructor
{ }
~ABC (); //Destructor
{ }
};
A destructor never takes any contentions nor does it return
any worth. It is conjured certainly by the compiler on the exit of
the program. It deallocates the memory of the object that is not,
at this point required. We can utilize an erase administrator to
free that memory in the destructor.
Example
In class string, another administrator was utilized to
designate a memory to a pointer so a destructor ought to have
an erase administrator to decimate the memory of the pointer as
given underneath.
Class string
{
public:
~string () //destructor
{
delete n;
}
};
Destructor
has same name
as class name
procceded by
~(tilde)
Called
automatically
when the object
is out of scope
has no
arguments and
does not return
any value
Vaibhav Masaye Page | 8
equivalent to the class name however went before by a tilde (~)
sign.
Example: the destructor for class ABC is given as;
Class ABC
{
public:
ABC (); //Constructor
{ }
~ABC (); //Destructor
{ }
};
A destructor never takes any contentions nor does it return
any worth. It is conjured certainly by the compiler on the exit of
the program. It deallocates the memory of the object that is not,
at this point required. We can utilize an erase administrator to
free that memory in the destructor.
Example
In class string, another administrator was utilized to
designate a memory to a pointer so a destructor ought to have
an erase administrator to decimate the memory of the pointer as
given underneath.
Class string
{
public:
~string () //destructor
{
delete n;
}
};
Destructor
has same name
as class name
procceded by
~(tilde)
Called
automatically
when the object
is out of scope
has no
arguments and
does not return
any value

Unit 20: Advanced Programming
Vaibhav Masaye Page | 9
o The relationship between Abstract classes and interfaces
➢ Abstract classes
In Object-oriented programming, abstraction implies concealing the
unimportant subtleties from the client to zero in just on the basic
subtleties to expand productivity subsequently decreasing
unpredictability. In Object-oriented programming, abstraction is
accomplished by utilizing abstract classes. An abstract class catches
regular qualities of subclasses and might possibly contain any
abstract strategy. It can't be started up however can be just utilized
as a superclass by its subclasses.
➢ Interfaces
An interface is a class like a construct that contains just constants
and abstract methods. An interface characterizes the detail of a
bunch of constants and methods. The interface goes about as an
assurance or an agreement: any class that executes the interface is
ensured to give usage to these abstract methods. We can consider
an interface characterizing a bunch of guidelines, and a class that
executes this interface adjusts to these principles.
▪ Relationship between Abstract classes and interfaces
Parameter Abstract Class Interface
Default Method
Implementation
It can have default
method
implementation
Interfaces provide pure
abstraction & can’t have
implementation at all
Variables It may contain non-
final variables.
Variables declared in an
interface are by default
final
Keyword Used An abstract class can
be extended using the
keyword “extends
The interface should be
implemented using
keyword implements
Access Modifiers Can have public,
protected, private and
default modifier
Interface methods are by
default public. you can’t
use any other access
modifier with it
Speed of
Implementation
It is faster than the
interface
An Interface is somewhat
slower & require extra
indirection
Vaibhav Masaye Page | 9
o The relationship between Abstract classes and interfaces
➢ Abstract classes
In Object-oriented programming, abstraction implies concealing the
unimportant subtleties from the client to zero in just on the basic
subtleties to expand productivity subsequently decreasing
unpredictability. In Object-oriented programming, abstraction is
accomplished by utilizing abstract classes. An abstract class catches
regular qualities of subclasses and might possibly contain any
abstract strategy. It can't be started up however can be just utilized
as a superclass by its subclasses.
➢ Interfaces
An interface is a class like a construct that contains just constants
and abstract methods. An interface characterizes the detail of a
bunch of constants and methods. The interface goes about as an
assurance or an agreement: any class that executes the interface is
ensured to give usage to these abstract methods. We can consider
an interface characterizing a bunch of guidelines, and a class that
executes this interface adjusts to these principles.
▪ Relationship between Abstract classes and interfaces
Parameter Abstract Class Interface
Default Method
Implementation
It can have default
method
implementation
Interfaces provide pure
abstraction & can’t have
implementation at all
Variables It may contain non-
final variables.
Variables declared in an
interface are by default
final
Keyword Used An abstract class can
be extended using the
keyword “extends
The interface should be
implemented using
keyword implements
Access Modifiers Can have public,
protected, private and
default modifier
Interface methods are by
default public. you can’t
use any other access
modifier with it
Speed of
Implementation
It is faster than the
interface
An Interface is somewhat
slower & require extra
indirection
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

Unit 20: Advanced Programming
Vaibhav Masaye Page | 10
Normal Class It can extend only one
abstract class
Can implement multiple
interfaces
Constructors An abstract class can
have constructors
An interface can’t have
constructors
Multiple Inheritance An abstract class can
extend another class
and can implement
multiple Object-
oriented programming
interfaces
The interface can extend
another Object-oriented
programming interface
only
➢ When to use Abstract Class & When to use Interface?
Think about utilizing abstract classes in the accompanying cases:
• If I have some connected classes that need to have similar lines of
code
• When I need to characterize the non-static or non-last fields
• When there are methods or fields or require access modifiers other
than public
Think about utilizing interfaces in the accompanying cases:
• When I need to accomplish unadulterated abstraction
• If I need to utilize various inheritance, i.e., actualize more than one
interface
• When I need to determine the conduct of a specific information
type, yet not worried about who actualizes its conduct.
o Identify scenarios where class relationships are used
➢ Association
Association is a relationship between two objects. At the end of the day,
the association characterizes the variety between objects. we know about
balanced, one-to-many, many-to-one, many-to-numerous every one of
these words characterize an association between objects. A conglomeration
is an extraordinary type of association. An organization is an uncommon
type of total.
Example: A Student and a Faculty are having an association.
Vaibhav Masaye Page | 10
Normal Class It can extend only one
abstract class
Can implement multiple
interfaces
Constructors An abstract class can
have constructors
An interface can’t have
constructors
Multiple Inheritance An abstract class can
extend another class
and can implement
multiple Object-
oriented programming
interfaces
The interface can extend
another Object-oriented
programming interface
only
➢ When to use Abstract Class & When to use Interface?
Think about utilizing abstract classes in the accompanying cases:
• If I have some connected classes that need to have similar lines of
code
• When I need to characterize the non-static or non-last fields
• When there are methods or fields or require access modifiers other
than public
Think about utilizing interfaces in the accompanying cases:
• When I need to accomplish unadulterated abstraction
• If I need to utilize various inheritance, i.e., actualize more than one
interface
• When I need to determine the conduct of a specific information
type, yet not worried about who actualizes its conduct.
o Identify scenarios where class relationships are used
➢ Association
Association is a relationship between two objects. At the end of the day,
the association characterizes the variety between objects. we know about
balanced, one-to-many, many-to-one, many-to-numerous every one of
these words characterize an association between objects. A conglomeration
is an extraordinary type of association. An organization is an uncommon
type of total.
Example: A Student and a Faculty are having an association.
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

Unit 20: Advanced Programming
Vaibhav Masaye Page | 11
➢ Aggregation
Aggregation is a special case of association. A directional association
between objects. When an object ‘has-a’ another object, then you have got
an aggregation between them. Direction between them specified which
object contains the other object. Aggregation is also called a “Has-a”
relationship.
➢ Composition
The composition is a unique instance of aggregation. In a more explicit
way, a confined aggregation is called composition. At the point when an
object contains the other object if the contained object can't exist without
the presence of a compartment object, at that point, it is called
composition.
Example: A class contains students. A student cannot exist without a
class. There exists composition between class and students.
➢ Abstraction
Abstraction is determining the system and concealing the execution level
data. Solidness will be based on the top of the abstraction. It gives you an
outline to follow while actualizing the subtleties. Abstraction decreases
intricacy by concealing low-level subtleties.
Example: A wire frame model of a car.
➢ Generalization
Generalization utilizes an "is-a" relationship from specialization to the
generalization class. Basic structure and conduct are utilized from the
specialization to the summed-up class. At a more extensive level, you can
comprehend this as an inheritance. Why I take the term inheritance is, you
can identify with this term quite well. Generalization is additionally called
an "Is-a" relationship.
Vaibhav Masaye Page | 11
➢ Aggregation
Aggregation is a special case of association. A directional association
between objects. When an object ‘has-a’ another object, then you have got
an aggregation between them. Direction between them specified which
object contains the other object. Aggregation is also called a “Has-a”
relationship.
➢ Composition
The composition is a unique instance of aggregation. In a more explicit
way, a confined aggregation is called composition. At the point when an
object contains the other object if the contained object can't exist without
the presence of a compartment object, at that point, it is called
composition.
Example: A class contains students. A student cannot exist without a
class. There exists composition between class and students.
➢ Abstraction
Abstraction is determining the system and concealing the execution level
data. Solidness will be based on the top of the abstraction. It gives you an
outline to follow while actualizing the subtleties. Abstraction decreases
intricacy by concealing low-level subtleties.
Example: A wire frame model of a car.
➢ Generalization
Generalization utilizes an "is-a" relationship from specialization to the
generalization class. Basic structure and conduct are utilized from the
specialization to the summed-up class. At a more extensive level, you can
comprehend this as an inheritance. Why I take the term inheritance is, you
can identify with this term quite well. Generalization is additionally called
an "Is-a" relationship.

Unit 20: Advanced Programming
Vaibhav Masaye Page | 12
Example: Consider there exists a class named Person. A student is a
person. A faculty is a person. Therefore, here the relationship between
student and person, similarly faculty and person are generalization.
➢ Realization
Realization is a relationship between the diagram class and the object
containing its particular usage level subtleties. This object is said to
understand the outline class. All in all, you can comprehend this as the
relationship between the interface and the actualizing class.
Example: A particular model of a car ‘GTB Fiorino’ that implements the
blueprint of a car realizes the abstraction.
➢ Dependency
Change in structure or conduct of a class influences the other related class,
at that point there is a dependency between those two classes. It need not
be similar the other way around. At the point when one class contains the
other class if this occurs.
Example: Relationship between shape and circle is dependency.
e.g. At the MVC portlet and Service Builder can identity the concept of
Inheritance.
Vaibhav Masaye Page | 12
Example: Consider there exists a class named Person. A student is a
person. A faculty is a person. Therefore, here the relationship between
student and person, similarly faculty and person are generalization.
➢ Realization
Realization is a relationship between the diagram class and the object
containing its particular usage level subtleties. This object is said to
understand the outline class. All in all, you can comprehend this as the
relationship between the interface and the actualizing class.
Example: A particular model of a car ‘GTB Fiorino’ that implements the
blueprint of a car realizes the abstraction.
➢ Dependency
Change in structure or conduct of a class influences the other related class,
at that point there is a dependency between those two classes. It need not
be similar the other way around. At the point when one class contains the
other class if this occurs.
Example: Relationship between shape and circle is dependency.
e.g. At the MVC portlet and Service Builder can identity the concept of
Inheritance.
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide
1 out of 28
Related Documents

Your All-in-One AI-Powered Toolkit for Academic Success.
+13062052269
info@desklib.com
Available 24*7 on WhatsApp / Email
Unlock your academic potential
Copyright © 2020–2025 A2Z Services. All Rights Reserved. Developed and managed by ZUCOL.