330 likes | 343 Views
This workshop explores the concept of interactive pattern stories, which capture the sequence of patterns used in a design example. Participants will engage in interactive sessions to generate ideas for alternative story paths and other pattern-based interactive stories.
E N D
Exploring design space with Interactive pattern storiesJames Siddle, Kevlin Henney ACCU 2009
Agenda • Workshop purpose • Concepts • Patterns, languages, sequences, stories • Introduction to interactive pattern stories • Interactive session • Introduction • Break out groups • Summary
Workshop purpose • Input to book writing effort • Gather feedback • what was learned from interactive stories • format likes/dislikes • Generate ideas • alternative story paths • ideas for other pattern-based interactive stories
Note on use of feedback • Please: • don’t divulge anything unless you’re happy for it to be used in the book • no confidential or sensitive information • Workshop attendees will be acknowledged • Will make specific acknowledgements if requested • Correction to printed materials • J. Siddle representing himself, not IBM
Patterns, languages, sequences, storiesKevlin Henney ACCU 2009
Patterns • Patterns capture recurring problem–solution pairs with respect to context • A pattern is named and contributes to design vocabulary • A 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 Stories • A pattern story brings out the sequence of patterns used in a design example • They 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
Pattern Sequences • A pattern sequence captures the underlying narrative behind a story • A sequence can be described and applied independent of a pattern story • Pattern sequences focus on incremental development • Pattern compounds are examples of named, short sequences • E.g., MVC, Interpreter, Pluggable Factory
JUnit Storyboard Distilled • JUnit storyboard can be summarised as a pattern sequence • I.e., Command, Template Method, Collecting Parameter, Class Adapter, Pluggable Selector, Composite • A summary of the sequence does not show how roles interact • E.g., what classes play what roles in Composite
Batch Iterator typedef sequence<any> many; interface SomeBatchIterator{booleannext_n(in unsigned long how_many, out many result); booleanskip_n(in unsigned long how_many);}; • A Batch Iterator is an Iterator that uses a Batch Method to express pull • Good for collection access in high-latency environments, e.g., distributed systems
Pattern Languages • A pattern language connects many patterns together • It captures connections and possibilities between different patterns, including alternatives, options and necessary steps • There may be many possible and practical sequences through a language • In the limit, a lone pattern sequence can be considered a narrow pattern language
STL Patterns Algorithm–Representation Separation Container Encapsulated Algorithm Stream Half-Open Iteration Range Counted Iteration Range Past-the-End Value Container-Encapsulated Algorithm Function Object Copied Value Iterator const Iterator Pointer Protocol Categorised Protocol Adaptor Smart Pointer Trait-LookupTemplate Tagged Category Deduction Helper Pluggable Type Nested Trait Pluggable Object Tagged Overload Traits Holder TraitsBase Class
Context Encapsulation ECO ECO, DCI ECO, DCI, RPC ECO, DCI, RPC, RSCO ECO, RPC, DCI ECO, RPC, DCI, RSCO ECO, RPC, RSCO ECO, RPC, RSCO, DCI Encapsulated Context Object Role-Partitioned Context Decoupled Context Interface Role-Specific Context Object
Design 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 Space • An individual design represents a point in a multidimensional design space • A pattern story represents a sequence of points, a path, in design space • A pattern represents a softly bounded region in design space • A pattern sequence represents a sequence of regions, a pattern language a branching set of regions
Introduction to Interactive Pattern StoriesJames Siddle ACCU 2009
Agenda • Introduction • Concepts • Interactive fiction attributes • Design choices • Example • Exploring design space • Interactive pattern story creation • What if…?
Introduction • Why interactive pattern stories? • Pattern story is one design example • Interactivity extends concept • Exploration • Engagement • Focus on learning
Concepts • 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 • Engaging format • Gameplay / fun • It’s about YOU • Illustrations showing consequences • Encourages self-motivated learning, exploration
Design 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
Example 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
Example 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.
Example 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!
Example 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 space • Read one full story, making choices • Digest outcome • Go back to the start, repeat • Skim read highlighted sentences, phrases • Try different paths, with different outcomes • Reflect
Interactive pattern story creation • Start with a linear story • Derive from a pattern language • Add a variation point • Guided by pattern text • Undesirable alternatives • Add more to create a tree • Branches may join • Provide just enough information
What if…? • Reading doesn’t appeal? Branching narratives are not constrained to written format
Thank you for Listening Questions?
Introduction • Breakout groups • Reading time – 10-15 mins • Discussion time – 20 mins • Capture output • Flipcharts • Key questions on handout form • Side 1-feedback, Side 2-ideas • Summary / Q&A