Refactoring Catalog 6: Refactoring APIs — Separate Query from Modifier, Remove Flag Argument, Parameterize Function, Factory Functions and Commands
API refactorings make the methods a class exposes clearer, safer and easier to test; but in an API shipped as a package, even adding a parameter with a default value breaks code that isn't recompiled. The post transforms Bookstore's Notifications module with twelve refactorings, showing with real output the old contract kept alive with [Obsolete], the CS0200 and CS0618 diagnostics, and the MissingMethodException of an old app running against the new DLL.
15 Nov 2026
·
17 min
·
11