the architect's clue bucket

120

Click here to load reader

Upload: ruth-malan

Post on 09-Jan-2017

14.600 views

Category:

Software


14 download

TRANSCRIPT

Page 1: The Architect's Clue Bucket

The architect's clue bucket

Ruth Malan

Page 2: The Architect's Clue Bucket

Image source: wikipedia

#OReillySACon

We are what we think.All that we are arises with our thoughts.With our thoughts we make the world.

– The Dhammapada

Page 3: The Architect's Clue Bucket

@RuthMalan#OReillySACon

I think about architecture

Page 4: The Architect's Clue Bucket

and what architects do

The architect has structural oversight

And makes tradeoffs

because… there’s only so much rope

Page 5: The Architect's Clue Bucket

and why

conveys behavior

Structure

to delight users

at scale

across contexts

Page 6: The Architect's Clue Bucket

and more why

when there’s tight coupling and bad code smells…

… the architect must address The Kludge

Page 7: The Architect's Clue Bucket

and why (again)Because mounting technical debt, ties the system to the past

… by its shoelaces

Page 8: The Architect's Clue Bucket

and howDraw on the walls!

Page 9: The Architect's Clue Bucket

and more howiterate

and experiment

to achieve fit to context and to purpose

Page 10: The Architect's Clue Bucket

Actually, a lot about how

Page 11: The Architect's Clue Bucket

I’m not kidding!DELIBERATEREASONDISCUSSDECIDERECONSIDER

Page 12: The Architect's Clue Bucket

DELIBERATION, n. The act of examining one's bread to determine which side it is buttered on.

REASON, v.t. To weight probabilities in the scales of desire.DISCUSSION, n. A method of confirming others in their errors.DECIDE, v.i. To succumb to the preponderance of one set of

influences over another set.RECONSIDER, v. To seek a justification for a decision already made.

— Ambrose Bierce, The Devil's Dictionary

Well, now I am

Page 13: The Architect's Clue Bucket

But not about drawing on the walls!

Page 14: The Architect's Clue Bucket

@RuthMalan#OReillySACon

Where We’re Headed:• some clues: design

principles, heuristics, tips, … and hints

• organizing clues: mapping the clue landscape

• getting clues: where and how to look

Page 15: The Architect's Clue Bucket

@RuthMalan#OReillySACon

“Architects must haveself-repairing egos”— Dana Bredemeyer

Page 16: The Architect's Clue Bucket

@RuthMalan#OReillySACon

The architect’s SCARS:• Separation of Concerns• crisp and resilient

Abstractions• balanced distribution of

Responsibilities• strive to Simplify — Grady Booch

Page 17: The Architect's Clue Bucket

@RuthMalan#OReillySACon

Separation of Concerns

“I go along with the natural makeup”…“when I come to the tricky parts, I slow down” — Chuang Tzu:

“The Dexterous Butcher”

Page 18: The Architect's Clue Bucket

Layers

presentation

business logic

data access

1996

SCARS: Separation of Concerns

application

domain

Page 19: The Architect's Clue Bucket

Source: geekandpoke.typepad.com/geekandpoke/2011/03/architectural-best-practices.html

(in 2011)

Page 20: The Architect's Clue Bucket

Layers

presentation

business logic

data access

1996

SCARS: Separation of Concerns

application

domain

Page 21: The Architect's Clue Bucket

— Ambrose Bierce, Devil’s Dictionary

ABATIS, n. [1.] Rubbish in front of a fort, to prevent the rubbish outside from molesting the rubbish inside.

Image: Engineering and the Mind’s Eye

Page 22: The Architect's Clue Bucket

— Ambrose Bierce, Devil’s Dictionary

ABATIS, n. [1.] Rubbish in front of a fort, to prevent the rubbish outside from molesting the rubbish inside.

Image: Engineering and the Mind’s Eye

“Design things to make their performance as insensitive to the unknown or uncontrollable external influence as practical.” — Eb Rechtin

Page 23: The Architect's Clue Bucket

Image: alistair.cockburn.us/Hexagonal+architecture

SCARS: Separation of Concerns

Hexagonal Architecture

Ports and adapters

Page 24: The Architect's Clue Bucket

Microservices!(in 2016)

Image: martinfowler.com/articles/microservices.html

Page 25: The Architect's Clue Bucket

Image: martinfowler.com/bliki/BoundedContext.html

Bounded Contexts in DDD

SCARS: Separation of Concerns

Page 26: The Architect's Clue Bucket

“There was a wall. It did not look important. It was built of uncut rocks roughly mortared. An adult could look right over it, and even a child could climb it. Where it crossed the roadway, instead of having a gate it degenerated into mere geometry, a line, an idea of boundary. But the idea was real. It was important. For seven generations there had been nothing in the world more important than that wall.Like all walls it was ambiguous, two-faced. What was inside it and what was outside it depended upon which side of it you were on.”

— Ursula K. Le Guin, The Dispossessed

Image: welshwaller.files.wordpress.com/2013/01/llwest-and-elan-valley-017.jpg

Page 27: The Architect's Clue Bucket

Boundaries: Conway’s Law

“Any organization that designs a system (defined broadly) will

produce a design whose structure is a copy of the organization's communication structure.”

—Melvyn Conway (in 1968!)

SCARS: Separation of Concerns

Page 28: The Architect's Clue Bucket

As programmers we deal with abstractions all the time and

we have to invent them in order to solve our problems

— Michael Feathers

SCARS: crisp and resilient Abstractions

SCARS: crisp and resilient Abstractions

Page 29: The Architect's Clue Bucket

“The purpose of abstraction is not to be vague, but to create a new semantic level in which one can be absolutely

precise.” — Dijkstra

SCARS: crisp and resilient Abstractions

Page 30: The Architect's Clue Bucket

Crisp Abstractions

Single Responsibility at the level of abstraction of the abstraction

SCARS: crisp and resilient Abstractions

Page 31: The Architect's Clue Bucket

SCARS: crisp and resilient Abstractions

Page 32: The Architect's Clue Bucket

Crisp and Resilient Abstractions

“We propose instead that one begins with a list of difficult design decisions or design

decisions which are likely to change. Each module is then designed to hide such a

decision from the others.” — David Parnas

SCARS: crisp and resilient Abstractions

Page 33: The Architect's Clue Bucket

Resilient AbstractionsResilient under change

SRP: each software module should have one and only one reason to change (Uncle Bob Martin)

Retrospective (Feathers)Prospective (thought experiments)

SCARS: crisp and resilient Abstractions

Page 34: The Architect's Clue Bucket

@RuthMalan#OReillySACon

SCARS: balanced distribution of Responsibilities

No “god” component(s)

Page 35: The Architect's Clue Bucket

@RuthMalan#OReillySACon

SCARS: strive to Simplify

“Simplify, simplify” — H. D. Thoreau

‘One “simplify” would have sufficed’ — Ralph Waldo Emerson, in response

Page 36: The Architect's Clue Bucket

“Simplify, simplify, Simplify”

“Communicate, Communicate, Communicate”

— Eberhardt Rechtin

SCARS: strive to Simplify

Page 37: The Architect's Clue Bucket

“Do the simplest thing that could possibly work”

Occam’s Razor: the simplest solution is usually the correct one

YAGNI

SCARS: strive to Simplify

Page 38: The Architect's Clue Bucket

Chad Fowler: “The older I get, the more I realize the biggest problem to solve in tech is to get people to stop making things harder than they have to be.”

Michael Feathers: “It's not that easy.”

SCARS: strive to Simplify

Page 39: The Architect's Clue Bucket

SCARS: strive to Simplify

Page 40: The Architect's Clue Bucket

focusing is saying “no”— Steve JobsGoogleX

SCARS: strive to Simplify

Page 41: The Architect's Clue Bucket

“old code doesn’t die; you have to kill it”

— Grady Booch

SCARS: strive to Simplify

Page 42: The Architect's Clue Bucket

How to kill codeStranglerApplication: “An alternative route is to gradually create a new system around the edges of the old, letting it grow slowly over several years until the old system is strangled.”

— Martin Fowler

SCARS: strive to Simplify

Page 43: The Architect's Clue Bucket

“disorder is easier and more permanent than order, which is difficult and

temporary”

— Jeremy Campbell

SCARS: strive to Simplify

Page 44: The Architect's Clue Bucket

“One bad programmer can easily create two new jobs a year.”

— David Parnas

SCARS: strive to Simplify

Page 45: The Architect's Clue Bucket

@RuthMalan#OReillySACon

The architect’s SCARS:• Separation of Concerns• crisp and resilient

Abstractions• balanced distribution of

Responsibilities• strive to Simplify — Grady Booch

Page 46: The Architect's Clue Bucket

@RuthMalan#OReillySACon

Essence of systems is:• Relationships• Interfaces• Form• Fit• Function

— Eberhardt Rechtin

Page 47: The Architect's Clue Bucket

@RuthMalan#OReillySACon

Essence of systems is:• Relationships• Interfaces• Form• Fit• Function

— Eberhardt Rechtin

“Relationships among the elements are what give systems their added value”

“Don’t partition by slicing through regions where high rates of information exchange are required””

Page 48: The Architect's Clue Bucket

@RuthMalan#OReillySACon

Essence of architecture is:• Structuring• Simplification• Compromise• Balance

— Eberhardt Rechtin

Page 49: The Architect's Clue Bucket

“dependencies are a tradeoff between the cost of maintaining the code yourself (and implementing it) & the cost of the risk of breakage” — Kent Beck

Balance: Tradeoffs/Compromise

Page 50: The Architect's Clue Bucket

Kent Beck’s 4 Rules of Simple Design

• passes its tests• minimises

duplication• reveals its intent• has fewer

classes/modules/packages…

Page 51: The Architect's Clue Bucket

More Clues

Systemantics by John Gall• New systems mean new problems• A complex system that works is invariably

found to have evolved from a simple system that worked• a complex system designed from scratch

never works and cannot be made to work• Systems develop goals the minute they come

into being

Page 52: The Architect's Clue Bucket

“Uncle Bob” Martin’s SOLID• Single Responsibility Principle

(SRP)• Open/Closed Principle (OCP)• Liskov Substitution Principle

(LSP)• Interface Segregation

Principle (ISP)• Dependency Inversion

Principle (DIP)

More Clues

Page 53: The Architect's Clue Bucket

97 Things

Page 54: The Architect's Clue Bucket

101 Things“Architecture is the thoughtful making of space."-LOUIS KAHN”

“Science works with chunks and bits and pieces of things with the continuity presumed, and [the artist] works only with the continuities of things with the chunks and bits and pieces presumed."-ROBERT PIRSIG, ZEN AND THE ART OF MOTORCYCLE MAINTENANCE”

“Just because an interesting idea occurs to you doesn't mean it belongs in the building you are designing. Subject every idea, brainstorm, random musing, and helpful suggestion to careful, critical consideration.” ― Matthew Frederick

Page 55: The Architect's Clue Bucket
Page 56: The Architect's Clue Bucket

“If you’re waiting on me to come to a conclusion where I give you a score from one through ten on the NDUF to BDUF scale (and it’s obviously five, right?), you’re going to be disappointed with this post. How much design should you do up front? Dude, I have no idea. Are you building a lunar rover? Probably a lot, then, because the Sea of Tranquility is a pretty unresponsive product owner. Are you cobbling together a minimum viable product and your hardware and business requirements may pivot at any moment? Well, probably not much. I can’t settle your design decisions and timing for you with acronyms or aphorisms.”

Erik Dietrich, Designs Don’t Emergehttp://www.daedtech.com/designs-dont-emerge/

Page 57: The Architect's Clue Bucket

Is this the part where we get to talk about Technical Wisdom?!

Page 58: The Architect's Clue Bucket

Wisdom factorsAnd factors and refactors

Page 59: The Architect's Clue Bucket

@RuthMalan#OReillySACon

Next:• some clues: design

principles, heuristics, tips, … and hints

• organizing clues: mapping the clue landscape

• getting clues: where and how to look

Page 60: The Architect's Clue Bucket

Maps: location, location, location

Page 61: The Architect's Clue Bucket

Maps asplaces to put things

Page 62: The Architect's Clue Bucket

Context System-in-Context(use, dev, ops)

System(Ecosystem)

Architecturestructure and mechanisms

“Requirements”design of system

capabilities

Strategyecosystem interventions

"Always design a thing by considering it in its next larger context" -- Eliel Saarinen

Page 63: The Architect's Clue Bucket

What

ARCHITECTURE

STRUCTURESoftware architecture refers to the high level structures of a software system, [..] It is the set of structures needed to reason about the software system. Each structure comprises software elements, relations among them, and properties of both elements and relations.

— wikipedia/Clements et al

Page 64: The Architect's Clue Bucket

“Good design doesn’t ’emerge’ like a welcome ray of sunshine

on a cloudy day.

—Erik Dietrich

Erik Dietrich, Designs Don’t Emergehttp://www.daedtech.com/designs-dont-emerge/

Page 65: The Architect's Clue Bucket

“It comes coughing, sputtering, screaming and grunting from the mud, like a drowning man being pulled from quicksand, and the effort of dragging it laboriously out leaves you

exhausted.”

Erik Dietrich, Designs Don’t Emergehttp://www.daedtech.com/designs-dont-emerge/Art by Amanda Muledy (@EEKitsabug)

Page 66: The Architect's Clue Bucket

Posit structure

Explore behavior

Revise structure

Explore — with sketches

Page 67: The Architect's Clue Bucket

Factor and Refactor

Posit responsibilities

Refine as explore behavior and different views

PatternsMetaphorsExperienceExisting stuff

“The responsibility of architecture is the architecture of responsibility.” -- Jan van Til 

Page 68: The Architect's Clue Bucket

What

ARCHITECTURE

STRUCTURE

interfaces

elements and relationships

How

BEHAVIOR

Page 69: The Architect's Clue Bucket

What

ARCHITECTURE

STRUCTURE

Logical

Conceptual

Execution

Page 70: The Architect's Clue Bucket

What(system view)

HowWhat(user view)

SYSTEM ARCHITECTURE

STRUCTURALBEHAVIORALCAPABILITIESCONTEXT

Why

v v

How well

FUNCTIONAL PROPERTIES

Page 71: The Architect's Clue Bucket

What(system view)

HowWhat(user view)

SYSTEM ARCHITECTURE

STRUCTURALBEHAVIORALCAPABILITIESCONTEXT

Why

v v

How well

FUNCTIONAL PROPERTIES

architecturally significant mechanisms

Page 72: The Architect's Clue Bucket

Architecturally Significant?

Page 73: The Architect's Clue Bucket

Architecturally significant?The demands (forces, properties, …) on the system that are challenging,

push the limits, require design attention

Page 74: The Architect's Clue Bucket

Source: Martin Fowlerhttp://martinfowler.com/articles/lmax.html

LMAX Disruptor MechanismChallenges: A trading platform needs very low latency - trades have to be processed quickly because the market is moving rapidly. A retail platform adds complexity because it has to do this for lots of people.

Page 75: The Architect's Clue Bucket

Context System-in-Context(use, dev, ops)

System(Ecosystem)

Architecturestructure and mechanisms

“Requirements”design of system

capabilities

Strategyecosystem interventions

Page 76: The Architect's Clue Bucket

@RuthMalan#OReillySACon

the elephant in the room

Page 77: The Architect's Clue Bucket

Messy!right system built right

Page 78: The Architect's Clue Bucket

Messier!System Design Intent

(what should be)System Design Reflection

(what is)

Page 79: The Architect's Clue Bucket

Ask “What does the code need?”

“What does the system need?”“What does the ecosystem need?”

Page 80: The Architect's Clue Bucket

What(system view)

HowWhat(user view)

SYSTEM ARCHITECTURE

STRUCTURALBEHAVIORALCAPABILITIESCONTEXT

Why

v v

How well

FUNCTIONAL PROPERTIES

good?right?successful?

Page 81: The Architect's Clue Bucket

What does it take to be successful?

Page 82: The Architect's Clue Bucket

Tell you a story… it was Alan Kay’s idea!

“the Constitution itself is a set of principles for building a very complex dynamic structure that should last for centuries”– Alan Kay

Page 83: The Architect's Clue Bucket

The Virginia

Plan

Image: ourdocuments.gov

Page 84: The Architect's Clue Bucket

The Constitutionof the

United States

Page 85: The Architect's Clue Bucket

“I confess that there are several parts of this constitution which I do not at present approve, but I am not sure I shall never approve them: For having lived long, I have experienced many instances of being obliged by better information, or fuller consideration, to change opinions even on important subjects, which I once thought right, but found to be otherwise. It is therefore that the older I grow, the more apt I am to doubt my own judgment, and to pay more respect to the judgment of others.”

— Benjamin Franklin

Page 86: The Architect's Clue Bucket

“The Federalist Papers are arguments that support different parts of the design of the Constitution. And the Constitution itself is a set of principles for building a very complex dynamic structure that should last for centuries”– Alan Kay

Page 87: The Architect's Clue Bucket

“it seems to have been reserved to the people of this country, [..], to decide the important question, whether societies of men are really capable or not, of establishing good government from reflection and choice, or whether they are forever destined to depend, for their political constitutions, on accident and force.”

Federalist No.1

Page 88: The Architect's Clue Bucket

The Federalist Papers, No. 51 addresses • checks and balances • separation of powers

Page 89: The Architect's Clue Bucket
Page 90: The Architect's Clue Bucket

Areas like• creativity and imagination• empathy, listening and observation• problem framing and solving

• perception and bias• experimentation

Personal Effectiveness

Page 91: The Architect's Clue Bucket

Areas like• Leadership• Collaboration• Communication and influence

• getting things done in organizations• Coach/consultant

Organizational Effectiveness“All problems are people

problems” — Jerry Weinberg

Page 92: The Architect's Clue Bucket

Areas like• Situational awareness

• context mapping• Differentiation and value definition• Direction setting

Strategic Effectiveness

Page 93: The Architect's Clue Bucket

@RuthMalan#OReillySACon

Next:• some clues: design

principles, heuristics, tips, … and hints

• organizing clues: mapping the clue landscape

• getting clues: where and how to look

Page 94: The Architect's Clue Bucket

Getting Clues: Steal

“Experience keeps a dear school, but fools will learn in no other.”

Benjamin Franklin

Steal: Stand on Shoulders

Page 95: The Architect's Clue Bucket

Shoulders to Stand On

Getting Clues: Steal

Page 96: The Architect's Clue Bucket

Shoulders to Stand On

Getting Clues: Steal

Page 97: The Architect's Clue Bucket

Shoulders to Stand On

Getting Clues: Steal

Page 98: The Architect's Clue Bucket

Getting Clues: Steal

Standing on Shoulders: by Analogy

Page 99: The Architect's Clue Bucket

Getting Clues: Steal

Shoulders of Giants

Page 100: The Architect's Clue Bucket

@RuthMalan#OReillySACon

More Getting Clues• Look• Listen• Ask• Imagine• Play

• Draw• Try• Try again• Show• Show again

Page 101: The Architect's Clue Bucket

Getting Clues: LookLarge portion of our brain is devoted to visual processing

Sighted people see all our waking hours

So we see, right?!

Page 102: The Architect's Clue Bucket

Getting Clues: Look“In fact, in medical terms, that’s our view.”

— Dan Ariely [joking]

“Are we in control of our own decisions?” Dan Ariely

Page 103: The Architect's Clue Bucket

Perception

Getting Clues: Lookhttps://www.xkcd.com/32/

Page 104: The Architect's Clue Bucket

Ladder of Inference

— Argyris and subsequently Peter Senge in Fifth Discipline

Getting Clues: Look

Page 105: The Architect's Clue Bucket

Pyramid of Belief

Getting Clues: LookLiminal thinking The pyramid of belief — Dave Gray

and self-sealing logic

Page 106: The Architect's Clue Bucket

Selection

Getting Clues: Look

What we are paying attention to, shapes what we perceive and pay

attention to.

Page 107: The Architect's Clue Bucket

Observe: Boyd’s OODA

Getting Clues: Look/Observe

Observe Orient Decide Act

Page 108: The Architect's Clue Bucket

Observe Orient Decide Act

“All architecture is design but not all design is architecture.Architecture represents the significant design decisions that shape a system, where significant is measured by cost of change.”

— Grady Booch, blog post, March 2, 2006

Page 109: The Architect's Clue Bucket

Observe Orient Decide Act

Getting Clues: Look/Observe

Title: short noun phraseContext: describes the forces at play; probably in tension, and should be called out as such Decision: describes our response to these forcesStatus: proposed, accepted, deprecated or supersededConsequences: describes the resulting context, after applying the decision

— Michael Nygard, Documenting Architecture Decisions, Nov 2011

Page 110: The Architect's Clue Bucket

Getting Clues: Look/Change PoV

“A change of perspective is worth

80 IQ points” — Alan Kay

Page 111: The Architect's Clue Bucket

Getting Clues: Look/Change PoV

Move to different PoV/vantage point• view system through different “lenses” — models (incl. instrumented

code), perspectives

Also, a matter of discipline• self-discipline, and • discipline of engineering: probe, model, reason, open criticism, come

up with counter arguments, come up with alternatives

Page 112: The Architect's Clue Bucket

Getting Clues: Look/Change PoV

“You don't understand something until you understand it more

than one way” — Marvin Minsky

Image: en.wikipedia.org/wiki/Marvin_Minsky#/media/File:Marvin_Minsky_at_OLPCb.jpg

Page 113: The Architect's Clue Bucket

“If you haven’t thought of three possibilities, you haven’t thought enough.” — Jerry Weinberg

Rule of Three

Page 114: The Architect's Clue Bucket

@RuthMalan#OReillySACon

More Getting Clues• Listen• Ask• Empathize• Imagine• Play

• Draw• Map• Try • Try again• Show

Page 115: The Architect's Clue Bucket

Context Mapping

Getting Clues: MapImage: blog.gardeviance.org/2015/02/an-introduction-to-wardley-value-chain.html

Wardley (Value Chain) MapsGrove-styled Context Maps

Image: bluesummitstrategy.com

Page 116: The Architect's Clue Bucket

Getting Clues: Map

Maps of Code

Page 117: The Architect's Clue Bucket

Getting Clues: Map

(Hand-drawn) Maps of Code

Page 118: The Architect's Clue Bucket

Questions

Getting Clues: Ask

• why?• 5 why’s• what if? why not?• Kipling’s 6 honest serving men

Page 119: The Architect's Clue Bucket

@RuthMalan#OReillySACon

More Getting Clues• Listen• Ask• Empathize• Imagine• Play

• Draw• Map• Try • Try again• Show

Page 120: The Architect's Clue Bucket

@RuthMalan#OReillySACon

Still Getting Clues

Ruth Malan

Web: bredemeyer.comalso: ruthmalan.comTwitter: @ruthmalan