SlideShare a Scribd company logo
1 of 21
Object Oriented
Analysis and
Design L5
IT1206
IT1206 - Institute of Technology, University of Moratuwa
Sameera Gunathilaka - OOAD
1
Sameera
Gunathilaka
Lead Software
Engineer
ERP Technical
Consultant
Principles of
Object-
Oriented
Systems
IT1206 - Institute of Technology, University of Moratuwa Sameera Gunathilaka -
OOAD 2
Class vs Object
Abstraction
Encapsulation
Inheritance
Generalization
Specialization
Association
Aggregation
Composition
Polymorphism
Class, Object..
what's that?
A class is a blueprint for creating
an object
IT1206 - Institute of Technology, University of Moratuwa Sameera Gunathilaka - OOAD 3
Class
• A class defines attributes
and behaviour
• attributes of the car
• It has common states and
behaviours
IT1206 - Institute of Technology, University of Moratuwa Sameera Gunathilaka -
OOAD 4
Object
• Instance of a class
• Create car objects with
specific details
• It has a id, state, behaviour
IT1206 - Institute of Technology, University of Moratuwa Sameera Gunathilaka -
OOAD 5
Abstraction
• What the object does
instead of how it is done
• Knowing a thing on a high
level
• You may never know how a
phone connects to another
phone when you enter a
number
IT1206 - Institute of Technology, University of Moratuwa Sameera Gunathilaka -
OOAD 6
Encapsulation
• Encapsulation is binding the
data and behaviors together
in a single unit
• Prevents user knowing
inside view( abstraction is
implemented)
IT1206 - Institute of Technology, University of Moratuwa Sameera Gunathilaka -
OOAD 7
Inheritance
(Generalization)
• organizing classes into a
hierarchy and enabling these
classes to inherit attributes and
behavior from classes above in
the hierarchy
• Inheritance describes an “IS A”
relationship
IT1206 - Institute of Technology, University of Moratuwa Sameera Gunathilaka -
OOAD 8
IT1206 - Institute of Technology, University of Moratuwa Sameera Gunathilaka -
OOAD 9
Generalization
IT1206 - Institute of Technology, University of Moratuwa Sameera Gunathilaka -
OOAD 10
Specialization
IT1206 - Institute of Technology, University of Moratuwa Sameera Gunathilaka -
OOAD 11
Generalization
vs
Specialization
IT1206 - Institute of Technology, University of Moratuwa Sameera Gunathilaka -
OOAD 12
Specialization is just opposite to Generalization
Generalization is a bottom-up approach
Specialization is a top-down approach
In generalization, a higher entity must have some lower entities
In specialization, a higher entity may not have any lower entity
present.
Generalization helps in reducing the number of entities
Specialization is just opposite it increases the number of entities
Association
owners feed pets, pets please
owners
The link/actions between two
objects
IT1206 - Institute of Technology, University of Moratuwa Sameera Gunathilaka - OOAD 13
Association vs Aggregation
vs Composition
1
4
• Aggregation and
composition are sub set of
Association
• Composition is a sub set of
Aggregation
IT1206 - Institute of Technology, University of Moratuwa
Sameera Gunathilaka - OOAD
Aggregation
a tail is a part of both dogs and
cats (also a composition)
IT1206 - Institute of Technology, University of Moratuwa Sameera Gunathilaka - OOAD 15
Composition
a cat is a kind of pet (also
inheritance / generalization)
IT1206 - Institute of Technology, University of Moratuwa Sameera Gunathilaka - OOAD 16
Aggregation vs Composition
IT1206 - Institute of Technology, University of Moratuwa
Sameera Gunathilaka - OOAD
17
Wheel can exist without the car File Cannot exist without the Folder
Polymorphism
• many different
implementations
• ability of an object to take
on many forms
• Draw() should be
implemented differently for
each shape
IT1206 - Institute of Technology, University of Moratuwa Sameera Gunathilaka -
OOAD 18
Speak() method in
Animal class is
implemented
differently in each
sub class
IT1206 - Institute of Technology, University of Moratuwa Sameera Gunathilaka - OOAD 19
Exercise
Write at least three real world examples from each concept.
• Class vs Object
• Abstraction
• Encapsulation
• Inheritance
• Generalization
• Specialization
• Association
• Aggregation
• Composition
• Polymorphism
IT1206 - Institute of Technology, University of Moratuwa
Sameera Gunathilaka - OOAD
20
Thank you
IT1206 - Institute of Technology, University of Moratuwa
Sameera Gunathilaka - OOAD
21

More Related Content

What's hot

IT1204- Software Engineering - L3
IT1204- Software Engineering - L3IT1204- Software Engineering - L3
IT1204- Software Engineering - L3BakerTilly US
 
IT1204- Introduction to software engineering - L1
IT1204- Introduction to software engineering - L1IT1204- Introduction to software engineering - L1
IT1204- Introduction to software engineering - L1BakerTilly US
 
IT1204- Software Engineering - L2
IT1204- Software Engineering - L2IT1204- Software Engineering - L2
IT1204- Software Engineering - L2BakerTilly US
 
IT1204 - Software Engineering L3- Extended
IT1204 - Software Engineering   L3- ExtendedIT1204 - Software Engineering   L3- Extended
IT1204 - Software Engineering L3- ExtendedBakerTilly US
 
Faq o-Matic system Abstract 2017
Faq o-Matic system Abstract 2017Faq o-Matic system Abstract 2017
Faq o-Matic system Abstract 2017ioshean
 
EAD and Its Implications in an M.ICT Graduate's Early Career
EAD and Its Implications in an M.ICT Graduate's Early CareerEAD and Its Implications in an M.ICT Graduate's Early Career
EAD and Its Implications in an M.ICT Graduate's Early CareerRichard
 
Appolo academy
Appolo academyAppolo academy
Appolo academyappoloo
 

What's hot (7)

IT1204- Software Engineering - L3
IT1204- Software Engineering - L3IT1204- Software Engineering - L3
IT1204- Software Engineering - L3
 
IT1204- Introduction to software engineering - L1
IT1204- Introduction to software engineering - L1IT1204- Introduction to software engineering - L1
IT1204- Introduction to software engineering - L1
 
IT1204- Software Engineering - L2
IT1204- Software Engineering - L2IT1204- Software Engineering - L2
IT1204- Software Engineering - L2
 
IT1204 - Software Engineering L3- Extended
IT1204 - Software Engineering   L3- ExtendedIT1204 - Software Engineering   L3- Extended
IT1204 - Software Engineering L3- Extended
 
Faq o-Matic system Abstract 2017
Faq o-Matic system Abstract 2017Faq o-Matic system Abstract 2017
Faq o-Matic system Abstract 2017
 
EAD and Its Implications in an M.ICT Graduate's Early Career
EAD and Its Implications in an M.ICT Graduate's Early CareerEAD and Its Implications in an M.ICT Graduate's Early Career
EAD and Its Implications in an M.ICT Graduate's Early Career
 
Appolo academy
Appolo academyAppolo academy
Appolo academy
 

More from BakerTilly US

IT1204 - Software Engineering - L12
IT1204 - Software Engineering - L12IT1204 - Software Engineering - L12
IT1204 - Software Engineering - L12BakerTilly US
 
IT1204 - Software Engineering - L11
IT1204 - Software Engineering - L11IT1204 - Software Engineering - L11
IT1204 - Software Engineering - L11BakerTilly US
 
IT1204 - Software Engineering - L10
IT1204 - Software Engineering - L10IT1204 - Software Engineering - L10
IT1204 - Software Engineering - L10BakerTilly US
 
IT1204 - Software Engineering - L9
IT1204 - Software Engineering - L9IT1204 - Software Engineering - L9
IT1204 - Software Engineering - L9BakerTilly US
 
IT1204 - Software engineering - L5
IT1204 - Software engineering - L5IT1204 - Software engineering - L5
IT1204 - Software engineering - L5BakerTilly US
 
IT1204 - Software Engineering -L8
IT1204 - Software Engineering -L8IT1204 - Software Engineering -L8
IT1204 - Software Engineering -L8BakerTilly US
 
IT1204 - Software Engineering - L7
IT1204 - Software Engineering - L7IT1204 - Software Engineering - L7
IT1204 - Software Engineering - L7BakerTilly US
 
IT1204 – Software Engineering L6
IT1204 – Software Engineering L6                                           IT1204 – Software Engineering L6
IT1204 – Software Engineering L6 BakerTilly US
 
IT1204 - Software Engineering - L4
IT1204 - Software Engineering - L4IT1204 - Software Engineering - L4
IT1204 - Software Engineering - L4BakerTilly US
 
Analysis of Service Gaps - Customer service management
Analysis of Service Gaps - Customer service management Analysis of Service Gaps - Customer service management
Analysis of Service Gaps - Customer service management BakerTilly US
 

More from BakerTilly US (10)

IT1204 - Software Engineering - L12
IT1204 - Software Engineering - L12IT1204 - Software Engineering - L12
IT1204 - Software Engineering - L12
 
IT1204 - Software Engineering - L11
IT1204 - Software Engineering - L11IT1204 - Software Engineering - L11
IT1204 - Software Engineering - L11
 
IT1204 - Software Engineering - L10
IT1204 - Software Engineering - L10IT1204 - Software Engineering - L10
IT1204 - Software Engineering - L10
 
IT1204 - Software Engineering - L9
IT1204 - Software Engineering - L9IT1204 - Software Engineering - L9
IT1204 - Software Engineering - L9
 
IT1204 - Software engineering - L5
IT1204 - Software engineering - L5IT1204 - Software engineering - L5
IT1204 - Software engineering - L5
 
IT1204 - Software Engineering -L8
IT1204 - Software Engineering -L8IT1204 - Software Engineering -L8
IT1204 - Software Engineering -L8
 
IT1204 - Software Engineering - L7
IT1204 - Software Engineering - L7IT1204 - Software Engineering - L7
IT1204 - Software Engineering - L7
 
IT1204 – Software Engineering L6
IT1204 – Software Engineering L6                                           IT1204 – Software Engineering L6
IT1204 – Software Engineering L6
 
IT1204 - Software Engineering - L4
IT1204 - Software Engineering - L4IT1204 - Software Engineering - L4
IT1204 - Software Engineering - L4
 
Analysis of Service Gaps - Customer service management
Analysis of Service Gaps - Customer service management Analysis of Service Gaps - Customer service management
Analysis of Service Gaps - Customer service management
 

Recently uploaded

5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 

Recently uploaded (20)

Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 

IT1206 Object Oriented Analysis and Design-L5

  • 1. Object Oriented Analysis and Design L5 IT1206 IT1206 - Institute of Technology, University of Moratuwa Sameera Gunathilaka - OOAD 1 Sameera Gunathilaka Lead Software Engineer ERP Technical Consultant
  • 2. Principles of Object- Oriented Systems IT1206 - Institute of Technology, University of Moratuwa Sameera Gunathilaka - OOAD 2 Class vs Object Abstraction Encapsulation Inheritance Generalization Specialization Association Aggregation Composition Polymorphism
  • 3. Class, Object.. what's that? A class is a blueprint for creating an object IT1206 - Institute of Technology, University of Moratuwa Sameera Gunathilaka - OOAD 3
  • 4. Class • A class defines attributes and behaviour • attributes of the car • It has common states and behaviours IT1206 - Institute of Technology, University of Moratuwa Sameera Gunathilaka - OOAD 4
  • 5. Object • Instance of a class • Create car objects with specific details • It has a id, state, behaviour IT1206 - Institute of Technology, University of Moratuwa Sameera Gunathilaka - OOAD 5
  • 6. Abstraction • What the object does instead of how it is done • Knowing a thing on a high level • You may never know how a phone connects to another phone when you enter a number IT1206 - Institute of Technology, University of Moratuwa Sameera Gunathilaka - OOAD 6
  • 7. Encapsulation • Encapsulation is binding the data and behaviors together in a single unit • Prevents user knowing inside view( abstraction is implemented) IT1206 - Institute of Technology, University of Moratuwa Sameera Gunathilaka - OOAD 7
  • 8. Inheritance (Generalization) • organizing classes into a hierarchy and enabling these classes to inherit attributes and behavior from classes above in the hierarchy • Inheritance describes an “IS A” relationship IT1206 - Institute of Technology, University of Moratuwa Sameera Gunathilaka - OOAD 8
  • 9. IT1206 - Institute of Technology, University of Moratuwa Sameera Gunathilaka - OOAD 9
  • 10. Generalization IT1206 - Institute of Technology, University of Moratuwa Sameera Gunathilaka - OOAD 10
  • 11. Specialization IT1206 - Institute of Technology, University of Moratuwa Sameera Gunathilaka - OOAD 11
  • 12. Generalization vs Specialization IT1206 - Institute of Technology, University of Moratuwa Sameera Gunathilaka - OOAD 12 Specialization is just opposite to Generalization Generalization is a bottom-up approach Specialization is a top-down approach In generalization, a higher entity must have some lower entities In specialization, a higher entity may not have any lower entity present. Generalization helps in reducing the number of entities Specialization is just opposite it increases the number of entities
  • 13. Association owners feed pets, pets please owners The link/actions between two objects IT1206 - Institute of Technology, University of Moratuwa Sameera Gunathilaka - OOAD 13
  • 14. Association vs Aggregation vs Composition 1 4 • Aggregation and composition are sub set of Association • Composition is a sub set of Aggregation IT1206 - Institute of Technology, University of Moratuwa Sameera Gunathilaka - OOAD
  • 15. Aggregation a tail is a part of both dogs and cats (also a composition) IT1206 - Institute of Technology, University of Moratuwa Sameera Gunathilaka - OOAD 15
  • 16. Composition a cat is a kind of pet (also inheritance / generalization) IT1206 - Institute of Technology, University of Moratuwa Sameera Gunathilaka - OOAD 16
  • 17. Aggregation vs Composition IT1206 - Institute of Technology, University of Moratuwa Sameera Gunathilaka - OOAD 17 Wheel can exist without the car File Cannot exist without the Folder
  • 18. Polymorphism • many different implementations • ability of an object to take on many forms • Draw() should be implemented differently for each shape IT1206 - Institute of Technology, University of Moratuwa Sameera Gunathilaka - OOAD 18
  • 19. Speak() method in Animal class is implemented differently in each sub class IT1206 - Institute of Technology, University of Moratuwa Sameera Gunathilaka - OOAD 19
  • 20. Exercise Write at least three real world examples from each concept. • Class vs Object • Abstraction • Encapsulation • Inheritance • Generalization • Specialization • Association • Aggregation • Composition • Polymorphism IT1206 - Institute of Technology, University of Moratuwa Sameera Gunathilaka - OOAD 20
  • 21. Thank you IT1206 - Institute of Technology, University of Moratuwa Sameera Gunathilaka - OOAD 21