Python Class Composition

Subscribers:
50,600
Published on ● Video Link: https://www.youtube.com/watch?v=b_8g3Q2tnQw



Duration: 0:00
230 views
10


Python Object Oriented Programming. Association describes relationships between classes. Under association, we have aggregation, and composition.
Aggregation implies a relationship where a class can exist independently of another class. Composition implies a relationship where a class cannot exist independently of another class. In this video, we cover the idea of composition, where a class is created and used only within another class. Thus, this relationship is class A OWNS class B. The idea differs from inheritance, where class A IS class B, if A inherits from B.

Source Code:
https://github.com/ImKennyYip/python-oop

Python Object Oriented Programming Playlist:
   • Python Object Oriented Programming  

Python Data Structures and Algorithms Playlist:
   • Python Data Structures and Algorithms  

Python Game Programming Projects Playlist:
   • Python Game Programming Tutorial  

Subscribe for more coding tutorials 😄 !