Slide 1

Slide 1 text

Maneuverable Web Architecture Michael T. Nygard - Cognitect Thursday, October 17, 13

Slide 2

Slide 2 text

Thesis Thursday, October 17, 13

Slide 3

Slide 3 text

Thesis ✤ Agile dev works at micro scale Thursday, October 17, 13

Slide 4

Slide 4 text

Thesis ✤ Agile dev works at micro scale ✤ Won’t create macro scale agility Thursday, October 17, 13

Slide 5

Slide 5 text

Maneuverability Thursday, October 17, 13

Slide 6

Slide 6 text

John Boyd ✤ Fighter pilot ✤ Air combat instructor ✤ Military theorist Thursday, October 17, 13

Slide 7

Slide 7 text

Thursday, October 17, 13

Slide 8

Slide 8 text

Kinetic to potential Thursday, October 17, 13

Slide 9

Slide 9 text

Kinetic to potential Potential to kinetic Thursday, October 17, 13

Slide 10

Slide 10 text

Energy-Manueverability (EM) Thursday, October 17, 13

Slide 11

Slide 11 text

Energy-Manueverability (EM) Kinetic ⟷ Potential Thursday, October 17, 13

Slide 12

Slide 12 text

Energy-Manueverability (EM) Kinetic ⟷ Potential Gain and Shed Momentum Thursday, October 17, 13

Slide 13

Slide 13 text

Energy-Manueverability (EM) Kinetic ⟷ Potential Gain and Shed Momentum Rapidly Change Maneuvers Thursday, October 17, 13

Slide 14

Slide 14 text

Thursday, October 17, 13

Slide 15

Slide 15 text

Thursday, October 17, 13

Slide 16

Slide 16 text

Maneuver Warfare Thursday, October 17, 13

Slide 17

Slide 17 text

Control tempo of engagement Maneuver Warfare Thursday, October 17, 13

Slide 18

Slide 18 text

Control tempo of engagement Take initiative Maneuver Warfare Thursday, October 17, 13

Slide 19

Slide 19 text

Control tempo of engagement Take initiative Send ambiguous signals Maneuver Warfare Thursday, October 17, 13

Slide 20

Slide 20 text

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 Thursday, October 17, 13

Slide 21

Slide 21 text

Maneuverable Web Architecture Thursday, October 17, 13

Slide 22

Slide 22 text

Control tempo of engagement Take initiative Send ambiguous signals Thursday, October 17, 13

Slide 23

Slide 23 text

“From now on, I control the tempo.” Thursday, October 17, 13

Slide 24

Slide 24 text

Cross-cutting Themes ✤ Plurality ✤ Break monoliths ✤ Use URIs with abandon ✤ c.f. “Architecture Without an End State” ✤ Augment upstream ✤ Contextualize downstream Thursday, October 17, 13

Slide 25

Slide 25 text

Techniques, not patterns… yet Thursday, October 17, 13

Slide 26

Slide 26 text

Sufficiently Abstract UI Counterexample: 100+ countries. 6 services per country. UI knows which services to call UI has forms specific to each one. Thursday, October 17, 13

Slide 27

Slide 27 text

Sufficiently Abstract UI 2 Better: Generic UI + Semantic HTML + Unobtrusive JavaScript Best: Above, plus either SSR or CSR, with CMS & toolkit for adaptable components. Thursday, October 17, 13

Slide 28

Slide 28 text

Services & scripting URL μService μService script ✤ Dynamic deployment of script ✤ Script addressable by URL Thursday, October 17, 13

Slide 29

Slide 29 text

Immutable values, monotonic succession Ref Value at TN Thursday, October 17, 13

Slide 30

Slide 30 text

Ref Value at TN Value at TN+1 Immutable values, monotonic succession Thursday, October 17, 13

Slide 31

Slide 31 text

Value Semantics Ref Semantics Values do not change Change is atomic No observable intermediate states Equality is identity Equality based on referent Thursday, October 17, 13

Slide 32

Slide 32 text

Value Semantics Ref Semantics Values do not change Change is atomic No observable intermediate states Equality is identity Equality based on referent Thursday, October 17, 13

Slide 33

Slide 33 text

Value Semantics Ref Semantics Values do not change Change is atomic No observable intermediate states Equality is identity Equality based on referent Thursday, October 17, 13

Slide 34

Slide 34 text

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 Thursday, October 17, 13

Slide 35

Slide 35 text

Example: Shopping Cart as Value Add: function from Cart, Item, Qty to Cart Remove: function from Cart, Item to Cart Cart is a number Thursday, October 17, 13

Slide 36

Slide 36 text

Example: Shopping Cart as Value Cart0 User Cart «ref» Thursday, October 17, 13

Slide 37

Slide 37 text

Example: Shopping Cart as Value Cart0 User Cart «ref» Add Thursday, October 17, 13

Slide 38

Slide 38 text

Example: Shopping Cart as Value Cart0 User Cart «ref» Add Cart0 User Cart «ref» Cart1 Thursday, October 17, 13

Slide 39

Slide 39 text

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. Thursday, October 17, 13

Slide 40

Slide 40 text

Complected solution Daily job wakes up, scans cards, creates warnings, sends email, checks bounces. User ID Sent on Warning ID Bounced? Token Expiration Card ID User ID User Email Thursday, October 17, 13

Slide 41

Slide 41 text

Minimal, generalized solution At: at datetime, call this URL. Template: accept body + params to format text Lead time: generate series of datetimes Mailer: send email to addr, track bounces Thursday, October 17, 13

Slide 42

Slide 42 text

Minimal, generalized solution Registration At 3. Several calls to "At". Provide URLs for script Script Engine 2. create new script, get URL Lead time 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 Thursday, October 17, 13

Slide 43

Slide 43 text

Issue identifiers ✤ Every service issues identifiers ✤ No restrictions on use Catalog Create Add Query catalog ID Thursday, October 17, 13

Slide 44

Slide 44 text

Policy Proxy Client Query catalog ID client ID Catalog Policy Proxy F: client → catalog Thursday, October 17, 13

Slide 45

Slide 45 text

Faceted identities User Ledger Cart Dept. Address Book Wish List Concierge Company Thursday, October 17, 13

Slide 46

Slide 46 text

Faceted identities ✤ IDs all issued by services ✤ Relationships externalized Catalog Company Item SKU Microsite Prize Pool Thursday, October 17, 13

Slide 47

Slide 47 text

Explicit context Implicit Explicit Bare identifiers URLs State names State machines Assumed channel Reply-to queue Thursday, October 17, 13

Slide 48

Slide 48 text

Self-defense ✤ Required for use without permission ✤ Protect from overload ✤ Allow cut off of maluser ✤ Important for operational safety and authorization Client Query Catalog Policy Proxy F: client → catalog client ID catalog ID gateway trusted untrusted Thursday, October 17, 13

Slide 49

Slide 49 text

Self-defense 2 ✤ Also applies to outcalls Payment Processor gateway The Collector trusted untrusted Thursday, October 17, 13

Slide 50

Slide 50 text

Half-duplex testing Wrong 1. Set up mock 2. Set up call 3. Make call 4. Assertions about result 5. Verify mock was called Thursday, October 17, 13

Slide 51

Slide 51 text

Half-duplex testing Wrong 1. Set up mock 2. Set up call 3. Make call 4. Assertions about result 5. Verify mock was called Right - call side 1. Set up mock 2. Set up call 3. Make call 4. Verify mock was called correctly. Thursday, October 17, 13

Slide 52

Slide 52 text

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. Thursday, October 17, 13

Slide 53

Slide 53 text

Other techniques I’m not 100% sure about ✤ Separate query from action ✤ Never deploy together ✤ Tell, don’t ask ✤ Unbundle parameters Thursday, October 17, 13

Slide 54

Slide 54 text

Maneuverability and tempo Thursday, October 17, 13

Slide 55

Slide 55 text

Thanks! Michael T. Nygard Cognitect [email protected] @mtnygard Thursday, October 17, 13