Avoid Surprises in Your Architecture

So beauty is about consistency and avoiding surprises. Fine. But what you consider a surprise depends on context. In the real world, you won’t be surprised to see an elephant at the zoo, but you’d probably rub your eyes if you saw one in your front yard (at least here in Sweden, where I live). Context matters in software, too (elephants less).

When you use beauty as a reasoning tool, you need principles to measure against. This is where patterns help. Let’s see how we can use them to detect nasty surprises in our designs.

Measure Against Your Patterns

We’ve already performed a few analyses on Code Maat. Now we’ll look at its overall architecture. Let’s start by defining its architectural boundaries.

Code ...

Get Your Code as a Crime Scene 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.