Exploring design space with Interactive pattern stories James Siddle, Kevlin Henney ACCU 2009
Jan 17, 2016
Exploring design space with Interactive pattern storiesJames Siddle, Kevlin Henney
Exploring design space with Interactive pattern storiesJames Siddle, Kevlin Henney
ACCU 2009ACCU 2009
AgendaAgenda
Workshop purposeConcepts
Patterns, languages, sequences, stories
Introduction to interactive pattern stories
Interactive sessionIntroductionBreak out groupsSummary
Workshop purposeConcepts
Patterns, languages, sequences, stories
Introduction to interactive pattern stories
Interactive sessionIntroductionBreak out groupsSummary
Workshop purposeWorkshop purpose
Input to book writing effortGather feedback
what was learned from interactive stories
format likes/dislikesGenerate ideas
alternative story pathsideas for other pattern-based
interactive stories
Input to book writing effortGather feedback
what was learned from interactive stories
format likes/dislikesGenerate ideas
alternative story pathsideas for other pattern-based
interactive stories
Note on use of feedbackNote on use of feedback
Please:don’t divulge anything unless you’re
happy for it to be used in the bookno confidential or sensitive information
Workshop attendees will be acknowledgedWill make specific acknowledgements
if requestedCorrection to printed materials
J. Siddle representing himself, not IBM
Please:don’t divulge anything unless you’re
happy for it to be used in the bookno confidential or sensitive information
Workshop attendees will be acknowledgedWill make specific acknowledgements
if requestedCorrection to printed materials
J. Siddle representing himself, not IBM
Patterns, languages, sequences, storiesKevlin Henney
Patterns, languages, sequences, storiesKevlin Henney
ACCU 2009ACCU 2009
PatternsPatterns
Patterns capture recurring problem–solution pairs with respect to contextA pattern is named and contributes to
design vocabularyA problem is characterised in terms of
forces and the solution offers an approach with consequences (both pros and cons)
A pattern represents a design decision, whether conscious or not, explicit or not
Patterns capture recurring problem–solution pairs with respect to contextA pattern is named and contributes to
design vocabularyA problem is characterised in terms of
forces and the solution offers an approach with consequences (both pros and cons)
A pattern represents a design decision, whether conscious or not, explicit or not
Pattern StoriesPattern Stories
A pattern story brings out the sequence of patterns used in a design exampleThey capture the conceptual
narrative behind a given piece of design, whether from a system in production or an illustrative example
Forces and consequences are played out in order, each decision illustrated concretely
A pattern story brings out the sequence of patterns used in a design exampleThey capture the conceptual
narrative behind a given piece of design, whether from a system in production or an illustrative example
Forces and consequences are played out in order, each decision illustrated concretely
JUnit StoryboardJUnit Storyboard
POSA4 Warehouse StoryPOSA4 Warehouse Story
Pattern SequencesPattern Sequences
A pattern sequence captures the underlying narrative behind a storyA sequence can be described and
applied independent of a pattern storyPattern sequences focus on
incremental developmentPattern compounds are examples of
named, short sequencesE.g., MVC, Interpreter, Pluggable
Factory
A pattern sequence captures the underlying narrative behind a storyA sequence can be described and
applied independent of a pattern storyPattern sequences focus on
incremental developmentPattern compounds are examples of
named, short sequencesE.g., MVC, Interpreter, Pluggable
Factory
JUnit Storyboard DistilledJUnit Storyboard Distilled
JUnit storyboard can be summarised as a pattern sequenceI.e., Command, Template Method,
Collecting Parameter, Class Adapter, Pluggable Selector, Composite
A summary of the sequence does not show how roles interactE.g., what classes play what roles in
Composite
JUnit storyboard can be summarised as a pattern sequenceI.e., Command, Template Method,
Collecting Parameter, Class Adapter, Pluggable Selector, Composite
A summary of the sequence does not show how roles interactE.g., what classes play what roles in
Composite
Batch IteratorBatch Iterator
A Batch Iterator is an Iterator that uses a Batch Method to express pullGood for collection access in high-
latency environments, e.g., distributed systems
A Batch Iterator is an Iterator that uses a Batch Method to express pullGood for collection access in high-
latency environments, e.g., distributed systemstypedef sequence<any> many;
interface SomeBatchIterator{ boolean next_n(in unsigned long how_many, out many result); boolean skip_n(in unsigned long how_many);};
typedef sequence<any> many;interface SomeBatchIterator{ boolean next_n(in unsigned long how_many, out many result); boolean skip_n(in unsigned long how_many);};
Pattern LanguagesPattern Languages
A pattern language connects many patterns togetherIt captures connections and possibilities
between different patterns, including alternatives, options and necessary steps
There may be many possible and practical sequences through a languageIn the limit, a lone pattern sequence can
be considered a narrow pattern language
A pattern language connects many patterns togetherIt captures connections and possibilities
between different patterns, including alternatives, options and necessary steps
There may be many possible and practical sequences through a languageIn the limit, a lone pattern sequence can
be considered a narrow pattern language
STL PatternsSTL PatternsAlgorithm–Algorithm–
Representation Representation SeparationSeparation
ContainerContainerStreamStream
IteratorIterator
Half-Open Half-Open Iteration RangeIteration RangeCounted Counted
Iteration RangeIteration RangePast-the-Past-the-End ValueEnd Value
Pointer Pointer ProtocolProtocol
Smart Smart PointerPointer
Categorised Categorised ProtocolProtocol
Pluggable Pluggable TypeType
Pluggable Pluggable ObjectObject
Encapsulated Encapsulated AlgorithmAlgorithm
Container-Container-Encapsulated Encapsulated
AlgorithmAlgorithmCopied Copied ValueValue
constconst IteratorIterator
AdaptorAdaptor
Deduction Deduction HelperHelper
Tagged Tagged CategoryCategory
Tagged Tagged OverloadOverload
Nested Nested TraitTrait
Traits Traits HolderHolder
TraitsTraitsBase ClassBase Class
Trait-LookupTrait-LookupTemplateTemplate
Function Function ObjectObject
Context EncapsulationContext Encapsulation
Decoupled Context Interface
Role-Specific Context Object
Encapsulated Context Object
Role-Partitioned Context
ECOECO
ECO, DCIECO, DCI
ECO, DCI, RPCECO, DCI, RPC
ECO, DCI, RPC, RSCOECO, DCI, RPC, RSCO
ECO, RPC, DCIECO, RPC, DCI
ECO, RPC, DCI, RSCOECO, RPC, DCI, RSCO
ECO, RPC, RSCOECO, RPC, RSCO
ECO, RPC, RSCO, DCIECO, RPC, RSCO, DCI
DesignDesign
As a noun, design is the named (although sometimes unnameable) structure or behavior of a system whose presence resolves or contributes to the resolution of a force or forces on that system. A design thus represents one point in a potential decision space. A design may be singular (representing a leaf decision) or it may be collective (representing a set of other decisions)....
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
Design SpaceDesign Space
An individual design represents a point in a multidimensional design spaceA pattern story represents a sequence
of points, a path, in design spaceA pattern represents a softly
bounded region in design spaceA pattern sequence represents a
sequence of regions, a pattern language a branching set of regions
An individual design represents a point in a multidimensional design spaceA pattern story represents a sequence
of points, a path, in design spaceA pattern represents a softly
bounded region in design spaceA pattern sequence represents a
sequence of regions, a pattern language a branching set of regions
Introduction to Interactive Pattern StoriesJames Siddle
Introduction to Interactive Pattern StoriesJames Siddle
ACCU 2009ACCU 2009
AgendaAgenda
Introduction Concepts Interactive fiction attributes Design choices Example Exploring design space Interactive pattern story creation What if…?
Introduction Concepts Interactive fiction attributes Design choices Example Exploring design space Interactive pattern story creation What if…?
IntroductionIntroduction
Why interactive pattern stories?Pattern story is one design
example Interactivity extends concept
ExplorationEngagement
Focus on learning
Why interactive pattern stories?Pattern story is one design
example Interactivity extends concept
ExplorationEngagement
Focus on learning
ConceptsConcepts
Pattern concepts Language, sequence, story
Interactive Fiction Branching narrative Second person (you) Game Examples – CYOA, Fighting Fantasy
Interactive pattern story Combine interactive fiction …with pattern story
Pattern concepts Language, sequence, story
Interactive Fiction Branching narrative Second person (you) Game Examples – CYOA, Fighting Fantasy
Interactive pattern story Combine interactive fiction …with pattern story
Interactive fiction attributes
Interactive fiction attributes
Engaging formatGameplay / fun It’s about YOU Illustrations showing
consequences
Encourages self-motivated learning, exploration
Engaging formatGameplay / fun It’s about YOU Illustrations showing
consequences
Encourages self-motivated learning, exploration
Design choicesDesign choices
Derive from connections in the pattern language Alternative patterns Optional patterns
Choices not limited to those in the pattern language Less desirable alternatives
Speculative versus Known
Explore the multiverse
Derive from connections in the pattern language Alternative patterns Optional patterns
Choices not limited to those in the pattern language Less desirable alternatives
Speculative versus Known
Explore the multiverse
ExampleExample
1
You are developing a request-handling framework, and are faced with the problem of how requests can be issued and handled so that the request handling framework can manipulate the requests explicitly, but in a uniform way.
You decide to objectify requests as COMMAND objects, based on a common, abstract, execution interface….
…
Go to 2
ExampleExample
2
You need to ensure that compound requests are handled. Compound requests correspond to multiple requests performed in sequence and as one; they are similarly undone as one.
The problem is, how can compound requests can be expressed without upsetting the simple and uniform treatment of COMMANDs within the framework?
If you want to create a special kind of COMMAND to deal with all compound requests, go to 3.
Otherwise, if you're happy for compound requests to be handled by the framework as it stands, go to 4.
ExampleExample
3
You decide to create a COMPOSITE COMMAND object that aggregates other COMMAND objects. To initialise a COMPOSITE COMMAND correctly, you add other COMMANDs (both primitive or COMPOSITE) to it in sequence.
This allows arbitrary compound requests to be composed, simplifying framework use, and reducing complexity and coupling. This enhances maintainability and evolvability of client code.
But this does reduce understandability of the framework– COMPOSITE implementations can be complex and non-obvious.
The End – you win!
ExampleExample
4
You decide to support compound requests through concrete COMMAND objects which aggregate other COMMAND objects.
The existing framework already supports this, but while this leaves your framework simpler, it means that clients of the framework will find it harder to use.
Clients will need to represent each compound request via a unique concrete class, which will be difficult to maintain and harder to evolve.
The End – you lose
Exploring design spaceExploring design space
Read one full story, making choices
Digest outcomeGo back to the start, repeat
Skim read highlighted sentences, phrases
Try different paths, with different outcomes
Reflect
Read one full story, making choices
Digest outcomeGo back to the start, repeat
Skim read highlighted sentences, phrases
Try different paths, with different outcomes
Reflect
Interactive pattern story creation
Interactive pattern story creation
Start with a linear story Derive from a pattern language
Add a variation pointGuided by pattern textUndesirable alternatives
Add more to create a treeBranches may join
Provide just enough information
Start with a linear story Derive from a pattern language
Add a variation pointGuided by pattern textUndesirable alternatives
Add more to create a treeBranches may join
Provide just enough information
What if…?What if…?
Reading doesn’t appeal? Branching narratives are not constrained to written format
Reading doesn’t appeal? Branching narratives are not constrained to written format
Thank you for Thank you for ListeningListening
Questions?Questions?
Thank you for Thank you for ListeningListening
Questions?Questions?
Interactive SessionJames Siddle, Kevlin HenneyInteractive SessionJames Siddle, Kevlin Henney
ACCU 2009ACCU 2009
IntroductionIntroduction
Breakout groupsReading time – 10-15 minsDiscussion time – 20 mins
Capture outputFlipchartsKey questions on handout formSide 1-feedback, Side 2-ideas
Summary / Q&A
Breakout groupsReading time – 10-15 minsDiscussion time – 20 mins
Capture outputFlipchartsKey questions on handout formSide 1-feedback, Side 2-ideas
Summary / Q&A