SlideShare a Scribd company logo
RELATIONSHIP
AMONG CLASSES
PRESENTED BY-
MAHADEO RAJAK(205117051)
DHEERENDRA MEHAR(205117053)
GUIDED BY-
DR. B. RAMADOSS SIR
2/19/2019 1
WHAT IS RELATIONSHIP ?
2/19/2019 2
RELATIONSHIP
• Kind of connection
• State of being connected
• Related to one another
2/19/2019 3
RELATIONSHIP AMONG CLASSES
Consider for a moment the similarities and differences
among the following classes of objects:-
flowers, daisies, red roses, yellow roses, petals, and ladybugs. We can
make the following observations:-
• A daisy is a kind of flower.
• A rose is a (different) kind of flower.
• Red roses and yellow roses are both kinds of roses.
• A petal is a part of both kinds of flowers.
• Ladybugs eat certain pests such as aphids, which may be infesting
certain kinds of flowers.
2/19/2019 4
TYPES OF RELATIONSHIP
• Association
• Aggregation
• Using
• Inheritance
• Instantiation
• Metaclass
2/19/2019 5
ASSOCIATION
• Group of links having common structure.
• Communication between classes
• Depicts the relationship between objects of one or more
classes.
Link
• A link represents a connection through which an object collaborates
with other objects.
• Rumbaugh has defined it as “a physical or conceptual connection
between objects”.
2/19/2019 6
DEGREE OF AN ASSOCIATION
Degree of an association denotes the number of classes involved
in a connection.
• Self Association
Connects Objects of Same Class.
• Binary Association
Connects Objects of Two Classes.
• N-Array Association
Connects Objects of Three or More Classes.
2/19/2019 7
SELF ASSOCIATION
2/19/2019 8
BINARY ASSOCIATION
2/19/2019 9
N-ARRAY ASSOCIATION
2/19/2019 10
AGGREGATION
• Special Type of Association
• Directional Association
• Denotes whole/part hierarchy
• If a Class have Entity Reference
• Referred as PART-OF or HAS-A Relationship
2/19/2019 11
AGGREGATION EXAMPLE
class Address
{ string country, state; int pincode;
public Address( int pincode , string country, string state)
{ this.pincode=pincode;this.country=country;this.state=state; } }
class Employee
{
int id; string name;
Address addr; // an instance of class Address is a “PART OF” class Employee
}
2/19/2019 12
USING
• Using another class as a parater to a method
• Declares an object of that class local to one one of the
member function
• Allow the client access only to the public interface of the
supplier
2/19/2019 13
USING EXAMPLE
class TemperatureController { public:
TemperatureController(Location);
~TemperatureController();
void process(const TemperatureRamp&);
//TemperatureController uses the services of the class TemperatureRamp
Minute schedule(const TemperatureRamp&) const;
private: Heater h;
};
2/19/2019 14
INHERITANCE
15
The capability of a class to drive properties and
characteristics from another class is called Inheritance.
2/19/2019
TYPES OF INHERITANCE
• Single Inheritance :
• Multiple Inheritance:
• Multilevel Inheritance:
• Hierarchical Inheritance:
• Hybrid Inheritance:
162/19/2019
SINGLE INHERITANCE:
17
A subclass derives from a single super-class or base class.
MULTIPLE INHERITENCE
A subclass derives from more than one super-classes or
base class.
2/19/2019
MULTILEVEL INHERITANCE
18
A subclass derives from a super-class which in turn is derived
from another class and so on.
2/19/2019
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.
2/19/2019 19
HYBRID INHERITANCE
20
A combination of multiple and multilevel inheritance so as
to form a lattice structure.
2/19/2019
INSTANTIATION
• An instance of a class is called an object.
• Instantiation is used to create an object instance from a
class (instantiate)
• confusingly enough
• particular realization of an abstraction or template
212/19/2019
SYNTAX AND EXAMPLE
Syntax :
className objectName = new className(inputParameters);
Example:
//class looks like this
public class Car {
String make;
public Car(string make) {
this.make = make;
}
}
//instantiation, elsewhere in the program
Car myCar = new Car("Honda"); //passing in Honda into the make variable
2/19/2019 22
METACLASS
• A class whose instances are themselves classes
• Smalltalk and CLOS languages support
• C++ does not
• Not all object-oriented programming languages
support metaclasses
232/19/2019
METACLASS EXAMPLE
242/19/2019
REFERENCES
• Grady Booch “Object-Oriented Analysis and Design”
• Tutorialspoint(www.tutorialspoint.com)
• Youtube
• IBM Knowledge Center
2/19/2019 25
THANK YOU
2/19/2019 26

More Related Content

Recently uploaded

Basic Civil Engineering Notes of Chapter-6, Topic- Ecosystem, Biodiversity G...
Basic Civil Engineering Notes of Chapter-6,  Topic- Ecosystem, Biodiversity G...Basic Civil Engineering Notes of Chapter-6,  Topic- Ecosystem, Biodiversity G...
Basic Civil Engineering Notes of Chapter-6, Topic- Ecosystem, Biodiversity G...
Denish Jangid
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
Nguyen Thanh Tu Collection
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
rosedainty
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
Excellence Foundation for South Sudan
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Solid waste management & Types of Basic civil Engineering notes by DJ Sir.pptx
Solid waste management & Types of Basic civil Engineering notes by DJ Sir.pptxSolid waste management & Types of Basic civil Engineering notes by DJ Sir.pptx
Solid waste management & Types of Basic civil Engineering notes by DJ Sir.pptx
Denish Jangid
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 

Recently uploaded (20)

Basic Civil Engineering Notes of Chapter-6, Topic- Ecosystem, Biodiversity G...
Basic Civil Engineering Notes of Chapter-6,  Topic- Ecosystem, Biodiversity G...Basic Civil Engineering Notes of Chapter-6,  Topic- Ecosystem, Biodiversity G...
Basic Civil Engineering Notes of Chapter-6, Topic- Ecosystem, Biodiversity G...
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Solid waste management & Types of Basic civil Engineering notes by DJ Sir.pptx
Solid waste management & Types of Basic civil Engineering notes by DJ Sir.pptxSolid waste management & Types of Basic civil Engineering notes by DJ Sir.pptx
Solid waste management & Types of Basic civil Engineering notes by DJ Sir.pptx
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 

Featured

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
Christy Abraham Joy
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
Vit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
MindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
GetSmarter
 

Featured (20)

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 

Relationship among classes

  • 1. RELATIONSHIP AMONG CLASSES PRESENTED BY- MAHADEO RAJAK(205117051) DHEERENDRA MEHAR(205117053) GUIDED BY- DR. B. RAMADOSS SIR 2/19/2019 1
  • 2. WHAT IS RELATIONSHIP ? 2/19/2019 2
  • 3. RELATIONSHIP • Kind of connection • State of being connected • Related to one another 2/19/2019 3
  • 4. RELATIONSHIP AMONG CLASSES Consider for a moment the similarities and differences among the following classes of objects:- flowers, daisies, red roses, yellow roses, petals, and ladybugs. We can make the following observations:- • A daisy is a kind of flower. • A rose is a (different) kind of flower. • Red roses and yellow roses are both kinds of roses. • A petal is a part of both kinds of flowers. • Ladybugs eat certain pests such as aphids, which may be infesting certain kinds of flowers. 2/19/2019 4
  • 5. TYPES OF RELATIONSHIP • Association • Aggregation • Using • Inheritance • Instantiation • Metaclass 2/19/2019 5
  • 6. ASSOCIATION • Group of links having common structure. • Communication between classes • Depicts the relationship between objects of one or more classes. Link • A link represents a connection through which an object collaborates with other objects. • Rumbaugh has defined it as “a physical or conceptual connection between objects”. 2/19/2019 6
  • 7. DEGREE OF AN ASSOCIATION Degree of an association denotes the number of classes involved in a connection. • Self Association Connects Objects of Same Class. • Binary Association Connects Objects of Two Classes. • N-Array Association Connects Objects of Three or More Classes. 2/19/2019 7
  • 11. AGGREGATION • Special Type of Association • Directional Association • Denotes whole/part hierarchy • If a Class have Entity Reference • Referred as PART-OF or HAS-A Relationship 2/19/2019 11
  • 12. AGGREGATION EXAMPLE class Address { string country, state; int pincode; public Address( int pincode , string country, string state) { this.pincode=pincode;this.country=country;this.state=state; } } class Employee { int id; string name; Address addr; // an instance of class Address is a “PART OF” class Employee } 2/19/2019 12
  • 13. USING • Using another class as a parater to a method • Declares an object of that class local to one one of the member function • Allow the client access only to the public interface of the supplier 2/19/2019 13
  • 14. USING EXAMPLE class TemperatureController { public: TemperatureController(Location); ~TemperatureController(); void process(const TemperatureRamp&); //TemperatureController uses the services of the class TemperatureRamp Minute schedule(const TemperatureRamp&) const; private: Heater h; }; 2/19/2019 14
  • 15. INHERITANCE 15 The capability of a class to drive properties and characteristics from another class is called Inheritance. 2/19/2019
  • 16. TYPES OF INHERITANCE • Single Inheritance : • Multiple Inheritance: • Multilevel Inheritance: • Hierarchical Inheritance: • Hybrid Inheritance: 162/19/2019
  • 17. SINGLE INHERITANCE: 17 A subclass derives from a single super-class or base class. MULTIPLE INHERITENCE A subclass derives from more than one super-classes or base class. 2/19/2019
  • 18. MULTILEVEL INHERITANCE 18 A subclass derives from a super-class which in turn is derived from another class and so on. 2/19/2019
  • 19. 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. 2/19/2019 19
  • 20. HYBRID INHERITANCE 20 A combination of multiple and multilevel inheritance so as to form a lattice structure. 2/19/2019
  • 21. INSTANTIATION • An instance of a class is called an object. • Instantiation is used to create an object instance from a class (instantiate) • confusingly enough • particular realization of an abstraction or template 212/19/2019
  • 22. SYNTAX AND EXAMPLE Syntax : className objectName = new className(inputParameters); Example: //class looks like this public class Car { String make; public Car(string make) { this.make = make; } } //instantiation, elsewhere in the program Car myCar = new Car("Honda"); //passing in Honda into the make variable 2/19/2019 22
  • 23. METACLASS • A class whose instances are themselves classes • Smalltalk and CLOS languages support • C++ does not • Not all object-oriented programming languages support metaclasses 232/19/2019
  • 25. REFERENCES • Grady Booch “Object-Oriented Analysis and Design” • Tutorialspoint(www.tutorialspoint.com) • Youtube • IBM Knowledge Center 2/19/2019 25