Back to Catalog
Code Smells
Couplers
Incomplete Library Class
When a library class lacks needed methods.
Intent & Description
'
🎯 Intent
Identify when you need to add methods to library classes but can’t modify them.
📋 Context
A library class is missing a method you need, so you add client code to work around it.
💡 Solution
Use Introduce Foreign Method to add the method as a wrapper, or create local extensions.'
Real-world Use Case
Use when library classes are missing needed functionality.
Source
📌 TL;DR
Instead of working around library limitations, add missing methods using extension techniques.