Jeremiah Flaga My thoughts and experiences on programming, life, atbp.

Architecture is the art of drawing lines -- Uncle Bob Martin


“Architecture is the art of drawing lines”

— Robert Martin

I heard that from Uncle Bob’s “Architecture: The Lost Years (Ruby Midwest 2011)” talk.

This is the diagram that he uses in his talk:


Lots of lines!

Do you see those two black lines in there?

I will redraw it to emphasize the two black lines:


Those are the boundaries.

And all arrowed lines that cross those boundaries always points inwards — towards the most important part/s of the system.

The reason why they are pointing inwards is so that the most important part will not become slaves of the details, as what Uncle Bob calls them, — so that the most important part will not be affected by the changes that will be made outside its boundaries.

We can redraw the diagram that Uncle Bob uses in that talk to look like this:


We can see that all the arrowed lines that cross the boundaries still points inwards — towards the middle — towards what they call the Business Logic part of the diagram.

If we move the black line at the right side so that it will look like this…


Does that look like the traditional 3-Layers Architecture that we know about? — Where the Business Logic Layer, the one at the middle, is dependent on the Data Layer, the one at the right.

Look at the arrowed lines that cross the boundaries

We can go from 3-Layers Architecture to Clean Architecture, and vice-versa, just by moving the lines!?

Amazing right!

Of course, moving lines in real world projects is much harder than moving lines in diagrams :laughing: :laughing: :laughing:

But they are doable! Right?