Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Metaphors We Code By (XProLo)

Metaphors We Code By (XProLo)

Thoughts about metaphor, software design, and why XP's System Metaphor concept has not been as widely adopted as the other XP technical practices.

Nat Pryce

May 19, 2014
Tweet

More Decks by Nat Pryce

Other Decks in Programming

Transcript

  1. “Each XP software project is guided by a single overarching

    metaphor. Sometimes the metaphor is "naive". ... Sometimes the metaphor needs a little explanation. The words used to identify technical entities should be consistently taken from the chosen metaphor. As development proceeds and the metaphor matures, the whole team will find new inspiration from examining the metaphor.” eXtreme Programming Explained, Kent Beck, 1999 The White Book
  2. [System Metaphor is] “What XP uses to unify an architecture

    and provide naming conventions. A simple shared story of how the system works, a metaphor. This story typically involves a handful of classes and patterns that shape the core flow of the system being built.” http://c2.com/cgi/wiki?SystemMetaphor as of 25/04/2014 The C2 Wiki
  3. “System Metaphor is itself a metaphor for a simple design

    with certain qualities. The most important quality is being able to explain the system design to new people without resorting to dumping huge documents on them. A design should have a structure that helps new people begin contributing quickly. The second quality is a design that makes naming classes and methods consistent.” http://www.extremeprogramming.org/rules/metaphor.html as of 25/04/2014 Ron Jeffries’ Current Description of XP
  4. Example: MORE IS UP From The Guardian website, 15/05/2014: “OVO

    Energy raises prices 3%” “...soaring values have revived idea of selling part of property portfolio...” “...nation's top 10% owning 44% of household wealth...” “Ministry of justice figures show number of convictions fell by only 69...” “Labour's nosedive in the opinion polls…”
  5. Mapping onto Different Target Domains Up Down Good Bad Happy

    Sad Controlling Controlled Pure Corrupt Abstract Concrete People Animals etc.
  6. Types of Conceptual Metaphor One thing for another, physical for

    abstract Up/Down, Near/Far, Facing towards/away Large/Small Inside/Outside, Boundary, Surface Extent, Covering, … Heavy Bright/Dark ... Ontological Orientation Size Containment Surface Weight Light ...
  7. Entailment and Coherence Read: “Following the report, shares in XYZ

    Inc took a nosedive and were in freefall by close of trading.” Think: “I should bail out of my investment in XYZ Inc. before the stock hits rock bottom.”
  8. Another Example: ARGUMENT IS WAR From The Guardian website, 17/05/2014:

    “Sussex police under fire for 'criminalising' fracking protests” “Nigel Farage has attempted to defend his controversial remarks...” “Michael Gove ordered to seal truce as Clegg hits back...”
  9. Example: AN ARGUMENT IS A BUILDING “Alice's argument is supported

    by recent research.” “The foundations of Bob’s argument are rather shaky.” “Carol has put together a convincing case.”
  10. ARGUMENT IS WAR AN ARGUMENT IS A BUILDING “To demolish

    my opponent’s argument I should undermine it by attacking its weak foundations.” Coherence Of Argument Metaphors
  11. Figurative / Unconventional Metaphor Metaphors We Live By, Lakoff and

    Johnson, 1980. “...in getting us to try to understand how it could be true, it makes possible a new understanding…”
  12. Idioms: Metaphors that have Kicked the Bucket Figurative metaphors can

    become common phrases in language When we forget the original meaning of the phrase, it loses its explanatory power. The phrase fossilises as an idiom
  13. Vertical Orientation ABSTRACT IS UP CONTROL IS UP PEOPLE IS

    UP HARDWARE IS DOWN (STATIC) DEPENDENCIES POINT DOWNWARDS ...
  14. Containment PROGRAMMING LANGUAGES ARE CONTAINERS CONTROL AT THE CENTER VULNERABLE

    IN THE CENTER “The system is in Java” Encapsulation Hexagonal Architecture Privilege ring levels ...
  15. User-facing features Front-end developer Database back-end Externally facing services ...

    Orientation: Facing Towards Something THE SYSTEM FACES THE USER THE SYSTEM FACES OTHER SYSTEMS
  16. Size Big Data Big Iron Software design diagrams could make

    more use of BIG IS IMPORTANT BIG IS IMPORTANT