Chapter 13. The Façade Pattern

A major problem with legacy designs, be they Java class systems, C# assemblies, C libraries from antiquity, or old database designs, is that they tend to have interfaces that get in the way of writing good tests.

The façade pattern lives in such problems and advises you on how to solve them. I will show you how it applies to database design. The first step is encapsulating the old database design behind a new one.

If you decide to go the façade route, you want to slowly “strangle” the old interface over time. You accomplish this using the same techniques you would employ to migrate clients over from direct table access to the use of stored procedures and views.

When embracing the façade pattern to implement a controlled ...

Get Test-Driven Database Development: Unlocking Agility now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.