Save this video — free

UNC COMP 301 - F26/Lec 12 - Adapter Design Pattern; Composition over Inheritance; Decorator DP

Muhammad Sayeed Ghani · 1:15:30 · Watch on YouTube

UNC COMP 301 - F26/Lec 12 - Adapter Design Pattern; Composition over Inheritance; Decorator DP Watch on YouTube →

Overview

Muhammad Sayeed Ghani explains how the Adapter pattern makes incompatible APIs work together and how the Decorator pattern adds features through composition rather than inheritance. Media-player adapters, dog and window feature combinations, and discounted price tags show how interface-based delegation avoids changing legacy code and limits subclass explosions; Java I/O streams provide a practical example of chained decorators.

Key takeaways

Chapters

0:00 Structural Patterns and the Adapter Pattern’s Purpose
3:22 Media-Player Interfaces and Why Not to Edit Legacy Code
9:23 Adapter Terminology: Client, Target, Adapter, and Adaptee
11:25 Adapter Implementation: Interface, Encapsulation, and Delegation
15:22 Running VLC and MP4 Players Through Separate Adapters
22:25 When Adapters Fit: Third-Party APIs and Payment Providers
27:59 Dog Features Show the Cost of Inheritance Combinations
32:38 Runtime Dog Configuration and When Inheritance Makes Sense
35:42 Window Features Create an Inheritance Class Explosion
41:23 Window Decorators Add Borders Through Delegation
49:32 Decorator UML, Interface-Based References, and Window Usage
56:07 Discounted Price Tags Modify Delegated Results
1:01:55 Chaining Decorators, Wrapper References, and Unwrapping
1:09:02 Extending PriceTag Interfaces and Decorating Java I/O
1:12:52 Decorator Trade-Offs: Ordering, Compatibility, and Encapsulation

Keep these chapters and the full searchable transcript in your own library.

Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Muhammad Sayeed Ghani.

Want the full transcript?

Save this video in YouTube Collector to get its complete searchable transcript, your own AI summaries, and a library that keeps every video you collect in one place.