Share the joy
Aggregation
Books is a part of Library. Dismiss of Library, it won’t lead dismiss of books.
class Library { Book book; }
Composition
Library has books. Dismiss of Library, then books will be dismissed as well.
class Library { Book book; }
Generalization/Extends
BankAccount implements Fixed Account
class BankAccount extends FixedAccount { }
Realization/Inheritance
BankAccount extends Fixed Account
class PrinterSetup implements Printer { }
Reference:
difference between association vs composition vs aggregation