manueverable architecture

46
Maneuverable Architecture Michael T. Nygard - Cognitect

Upload: michael-nygard

Post on 10-Apr-2017

377 views

Category:

Software


1 download

TRANSCRIPT

Page 1: Manueverable architecture

Maneuverable ArchitectureMichael T. Nygard - Cognitect

Page 2: Manueverable architecture

Thesis

✤ Agile dev works at micro scale

✤ Won’t create macro scale agility

Page 3: Manueverable architecture

Maneuverability

Page 4: Manueverable architecture

John Boyd

✤ Fighter pilot

✤ Air combat instructor

✤ Military theorist

Page 5: Manueverable architecture

Kinetic to potentialPotential to kinetic

Page 6: Manueverable architecture

Energy-Maneuverability (EM)

Kinetic ⟷ Potential

Gain and Shed Momentum

Rapidly Change Maneuvers

Page 7: Manueverable architecture
Page 8: Manueverable architecture
Page 9: Manueverable architecture

Control tempo

Take initiative

Send ambiguous signals

Maneuver Warfare

Page 10: Manueverable architecture

Note how orientation shapes observation, shapes decision, shapes action, and in turn is shaped by the feedback and other phenomena coming into our sensing or observing window.

Also note how the entire �loop� (not just orientation) is an ongoing many-sided implicit cross-referencing process of projection, empathy, correlation, and rejection.

From �The Essence of Winning and Losing,� John R. Boyd, January 1996.

Feed Forward

Observations Decision (Hypothesis)

Action (Test)

Cultural Traditions

Genetic Heritage

New Information Previous

Experience

Analyses & Synthesis Feed

Forward Feed

Forward

Implicit Guidance & Control

Implicit Guidance & Control

Unfolding Interaction

With Environment Unfolding

Interaction With

Environment Feedback

Feedback

Outside Information

Unfolding Circumstances

Observe Orient Decide Act

Defense and the National Interest, http://www.d-n-i.net, 2006

Page 11: Manueverable architecture

Maneuverable Architecture

Page 12: Manueverable architecture

Control tempo

Take initiative

Send ambiguous signals

Page 13: Manueverable architecture

“From now on, I control the tempo.”

Page 14: Manueverable architecture

Tempo is emergent.

Page 15: Manueverable architecture

Gain

Shed

Redirect

Page 16: Manueverable architecture

Typical IT architecture is a disaster for maneuverability.

Page 17: Manueverable architecture

Techniques, not patterns… yet

Page 18: Manueverable architecture

Disposability

✤ Infrastructure

✤ Code

✤ Dependencies

✤ Teams?

Page 19: Manueverable architecture

Architecture for Disposability

✤ Focus on representations✤ Messages✤ Async

Page 20: Manueverable architecture

Avoid sunk cost lock-in.

Page 21: Manueverable architecture

Sufficiently Abstract UI

Counterexample:

100+ countries.

6 services per country.

UI knows which services to call

UI has forms specific to each one.

Page 22: Manueverable architecture

Sufficiently Abstract UI 2

Better:Generic UI + Semantic HTML + Unobtrusive JavaScript

Best:Above, plus either SSR or CSR, with CMS & toolkit for adaptable components.

Page 23: Manueverable architecture

Services & scripting

URL

μService μService

script✤ Dynamic

deployment of script

✤ Script addressable by URL

Page 24: Manueverable architecture

Immutable values, monotonic succession

Ref Value at TN

Page 25: Manueverable architecture

Ref Value at TN

Value at TN+1

Immutable values, monotonic succession

Page 26: Manueverable architecture

Value Semantics Ref Semantics

Values do not changeChange is atomic

No observable intermediate states

Equality is identity Equality based on referent

Page 27: Manueverable architecture

Example: Perpetual string

✤ Perpetual string: store strings forever.✤ URL is SHA-256 hash of string.✤ Use for scripts, legal text.✤ Edit the script, get a new URL

Page 28: Manueverable architecture

Example: Shopping Cart as Value

Add: function from Cart, Item, Qty to Cart

Remove: function from Cart, Item to Cart

Cart is a number

Page 29: Manueverable architecture

Example: Shopping Cart as Value

Cart0

User

Cart«ref»

Add

Cart0

User

Cart«ref»

Cart1

Page 30: Manueverable architecture

Generalized minimalism

Feature: Send email to customer ahead of credit card expiration.

Complexity: Number of reminders and advance notice vary by tenant.

Required: Record email sent, bounced.

Page 31: Manueverable architecture

Complected solution

Daily job wakes up, scans cards, creates warnings, sends email, checks bounces.

User ID Sent onWarning ID Bounced?

Token ExpirationCard ID User ID

User Email

Page 32: Manueverable architecture

Minimal, generalized solution

At: at datetime, call this URL.

Template: accept body + params to format text

Before: generate series of datetimes

Mailer: send email to addr, track bounces

Page 33: Manueverable architecture

Minimal, generalized solution

RegistrationAt

3. Several calls to "At".Provide URLs for script

Script Engine

2. create new script, get URL

Before

1. create reminder dates

Reminder script

Much later: invoke reminder script

creates

Perpetual string

A. Get template

Template Mailer

B. Format message

C. Send message

Page 34: Manueverable architecture

Issue identifiers

✤ Every service issues identifiers

✤ No restrictions on use

Catalog

Create

Add

Query

catalog ID

Page 35: Manueverable architecture

Policy Proxy

ClientQuery

catalog ID

client ID

Catalog

Policy Proxy

F: client →

catalog

Page 36: Manueverable architecture

Faceted identities

User

Ledger

Cart

Dept.

Address Book

Wish List

Concierge

Company

Page 37: Manueverable architecture

Faceted identities

✤ IDs all issued by services

✤ Relationships externalized

Catalog

Company

Item

SKU

Microsite

Prize Pool

Page 38: Manueverable architecture

Explicit context

Implicit Explicit

Bare identifiers URLs

State names State machines

Assumed channel Reply-to queue

Page 39: Manueverable architecture

Self-defense

✤ Required for use without permission

✤ Protect from overload

✤ Allow cut off of maluser

✤ Important for operational safety and authorization

ClientQuery

Catalog

Policy Proxy

F: client →

catalog

client ID

catalog ID

gatewaytrusted

untrusted

Page 40: Manueverable architecture

Self-defense 2

✤ Also applies to outcalls

Payment

Processor

gateway

The

Collectortrusted

untrusted

Page 41: Manueverable architecture

Half-duplex testing

Wrong

1. Set up mock

2. Set up call

3. Make call

4. Assertions about result

5. Verify mock was called

Page 42: Manueverable architecture

Half-duplex testing

Right - call side

1. Set up mock

2. Set up call

3. Make call

4. Verify mock was called correctly.

Page 43: Manueverable architecture

Half-duplex testing

Right - call side

1. Set up mock

2. Set up call

3. Make call

4. Verify mock was called correctly.

Right - response side

1. Skip mock & call

2. Inject fake results

3. Verify results handled correctly.

Page 44: Manueverable architecture

Other techniques I’m not 100% sure about

✤ Continuation URL

✤ Separate query from action

✤ Never deploy together

✤ Tell, don’t ask

Page 45: Manueverable architecture

Tempo and Maneuverability

Page 46: Manueverable architecture

Thanks!

Michael T. NygardCognitect

[email protected]@mtnygard