Chapter 4. New Interface, Old Implementation
So you need to call a routine, and the interface makes it difficult/complicated/ confusing/tedious. Implement the interface you wish you could call and call it. Implement the new interface by simply calling the old one (you can inline the implementation later, after migrating all other callers).
Creating a pass-through interface is the micro-scale essence of software design. You want to make some behavior change. If the design were like thus and so, making that change would be easy(-er). So make the design like that.
The same impulse holds true when you are:
-
Coding backward—Start with the last line of a routine, as if you already had all the intermediate results you needed.
-
Coding test-first—Start with the test that needs to pass.
-
Designing helpers—If only I had a routine/object/service that did XXX, then the rest of this would be easy.