Skip to Content
Tidy First?
book

Tidy First?

by Kent Beck
October 2023
Intermediate to advanced
122 pages
1h 58m
English
O'Reilly Media, Inc.
Book available
Content preview from Tidy First?

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.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Building Micro-Frontends

Building Micro-Frontends

Luca Mezzalira
Learning Go

Learning Go

Jon Bodner
Head First Git

Head First Git

Raju Gandhi

Publisher Resources

ISBN: 9781098151232Errata Page