Maneuverable Web Architecture Michael T. Nygard - Cognitect Thursday, October 17, 13
Thesis Thursday, October 17, 13
Thesis ✤ Agile dev works at micro scale Thursday, October 17, 13
Thesis ✤ Agile dev works at micro scale ✤ Won’t create macro scale agility Thursday, October 17, 13
Maneuverability Thursday, October 17, 13
John Boyd ✤ Fighter pilot ✤ Air combat instructor ✤ Military theorist Thursday, October 17, 13
Thursday, October 17, 13
Kinetic to potential Thursday, October 17, 13
Potential to kinetic Kinetic to potential Thursday, October 17, 13
Energy-Manueverability (EM) Thursday, October 17, 13
Energy-Manueverability (EM) Kinetic ⟷ Potential Thursday, October 17, 13
Energy-Manueverability (EM) Kinetic ⟷ Potential Gain and Shed Momentum Thursday, October 17, 13
Energy-Manueverability (EM) Kinetic ⟷ Potential Gain and Shed Momentum Rapidly Change Maneuvers Thursday, October 17, 13
Thursday, October 17, 13
Thursday, October 17, 13
Maneuver Warfare Thursday, October 17, 13
Maneuver Warfare Control tempo of engagement Thursday, October 17, 13
Maneuver Warfare Control tempo of engagement Take initiative Thursday, October 17, 13
Maneuver Warfare Control tempo of engagement Take initiative Send ambiguous signals Thursday, October 17, 13
Observe Orient Decide Act Implicit Implicit Guidance Guidance Unfolding Cultural & Control & Control Circumstances Traditions Genetic Analyses & Heritage Action Decision Feed Observations Feed Feed Synthesis Forward Forward Forward (Hypothesis) (Test) New Previous Information Experience Outside Unfolding Information Interaction With Unfolding Environment Interaction Feedback With Feedback Environment 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. Defense and the National Interest, http://www.d-n-i.net, 2006 Thursday, October 17, 13
Maneuverable Web Architecture Thursday, October 17, 13
Control tempo of engagement Take initiative Send ambiguous signals Thursday, October 17, 13
“From now on, I control the tempo.” Thursday, October 17, 13
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
Techniques, not patterns… yet Thursday, October 17, 13
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
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
Services & scripting URL ✤ Dynamic script deployment of script ✤ Script addressable by URL μ Service μ Service Thursday, October 17, 13
Immutable values, monotonic succession Value at TN Ref Thursday, October 17, 13
Immutable values, monotonic succession Value at TN Ref Value at TN+1 Thursday, October 17, 13
Value Semantics Ref Semantics Thursday, October 17, 13
Value Semantics Ref Semantics Change is atomic Values do not change No observable intermediate states Thursday, October 17, 13
Value Semantics Ref Semantics Change is atomic Values do not change No observable intermediate states Equality is identity Equality based on referent Thursday, October 17, 13
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
Example: Shopping Cart as Value Cart is a number Add: function from Cart, Item, Qty to Cart Remove: function from Cart, Item to Cart Thursday, October 17, 13
Example: Shopping Cart as Value User Cart «ref» Cart0 Thursday, October 17, 13
Example: Shopping Cart as Value User Add Cart «ref» Cart0 Thursday, October 17, 13
Example: Shopping Cart as Value User User Add Cart Cart «ref» «ref» Cart0 Cart1 Cart0 Thursday, October 17, 13
Generalized minimalism Feature: Send email to customer ahead of credit card expiration. Required: Record email sent, bounced. Complexity: Number of reminders and advance notice vary by tenant. Thursday, October 17, 13
Complected solution User Email Warning ID User ID Sent on Bounced? Card ID User ID Token Expiration Daily job wakes up, scans cards, creates warnings, sends email, checks bounces. Thursday, October 17, 13
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
Minimal, generalized solution 3. Several calls to "At". Provide URLs for script Registration At 2. create new script, 1. create reminder dates get URL Much later: invoke reminder script Script Engine creates Lead time Reminder script C. Send message A. Get template B. Format message Perpetual Template Mailer string Thursday, October 17, 13
Issue identifiers Create Add ✤ Every service issues Query identifiers catalog ID ✤ No restrictions on use Catalog Thursday, October 17, 13
Policy Proxy Client Policy client ID F: client → Query Proxy catalog catalog ID Catalog Thursday, October 17, 13
Faceted identities Cart Ledger Company Dept. User Address Concierge Book Wish List Thursday, October 17, 13
Faceted identities Company Catalog ✤ IDs all issued by Prize Pool services Microsite Item ✤ Relationships externalized SKU Thursday, October 17, 13
Explicit context Implicit Explicit Bare identifiers URLs State names State machines Assumed channel Reply-to queue Thursday, October 17, 13
Self-defense Client Query ✤ Required for use without client ID untrusted permission gateway ✤ Protect from overload trusted Policy F: client → ✤ Allow cut off of maluser Proxy catalog ✤ Important for operational catalog ID safety and authorization Catalog Thursday, October 17, 13
Self-defense 2 The Collector trusted ✤ Also applies to outcalls gateway Payment untrusted Processor Thursday, October 17, 13
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
Half-duplex testing Wrong Right - call side 1. Set up mock 1. Set up mock 2. Set up call 2. Set up call 3. Make call 3. Make call 4. Assertions about result 4. Verify mock was called correctly. 5. Verify mock was called Thursday, October 17, 13
Half-duplex testing Right - response side Right - call side 1. Skip mock & call 1. Set up mock 2. Inject fake results 2. Set up call 3. Verify results handled correctly. 3. Make call 4. Verify mock was called correctly. Thursday, October 17, 13
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
Maneuverability and tempo Thursday, October 17, 13
Thanks! Michael T. Nygard Cognitect mtnygard@cognitect.com @mtnygard Thursday, October 17, 13
Recommend
More recommend