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.