Week 2 Design Examples and Designing for Change
- Slides: 55
Week 2 Design Examples and Designing for Change Alex Baker
Implementation Design l An implementation design is a road map – l An implementation design describes a path from system design to the outcome – l correct, complete, concise, verifiable, effective, … An implementation design describes what the implementers should do – l understandable, unambiguous, consistent, helpful, … elegant, partitionable, recomposable, resilient, … An implementation design is a guide towards future change – evolvable, …
Emphasis: Changability l Subtle l Requires foresight and careful balancing l An implementation design describes what the implementers should do – l elegant, partitionable, recomposable, resilient, … An implementation design is a guide towards future change – evolvable, …
Emphasis: Changability l l l Reusable Extensible Maintainable Portable Well-Documented Adaptable l l l l Efficiency Powerful Simplicity Readability Minimalistic Elegant Well-Organized Concise
Changability: Basic Principles l Low Coupling: Reducing interdependency – – l High Cohesion: Grouping functionality – – l Changes don’t propagate Reuse is facilitated Easier to find things Metaphor guides decisions Information Hiding
Information Hiding Made Very Simple l A List class with: 1) 2) get. Array() : Array get. Element. At(int i) : Element
Information Hiding Made Very Simple l A List class with: 1) 2) l Its too slow, so we switch to a hash table 1) 2) l get. Array() : Array get. Element. At(int i) : Element Everywhere you call get. Array needs changing Only List is changed Little things like this add up
The Ideal Program vs. …
Why the Emphasis on Changability? l Change abounds… – – – During coding After use Reuse for later projects
Why is there so Much Change? Designs Outcomes
Why is there so Much Change? Engineering Designs Physics Principles Existing Examples Outcomes
Why is there so Much Change? Software Engineering Designs Physics Principles Existing Examples Outcomes
Why is there so Much Change? Software Engineering Designs Physics Principles Existing Examples Outcomes
Why is there so Much Change? Software Engineering Designs Physics Principles Existing Examples Outcomes
Why the Emphasis on Changability? l Change abounds… – – – l During coding After use Reuse for later projects You usually just don’t know for sure…
Changes During Coding l Refinement of the high level design l Dependencies reveal themselves – – Oh, I need to know [X]. I can’t access that data? l ‘It turns out this class is HUGE’ l Need to redesign as you go Can changes be made within the design? l
Changes during Use l Potential breakdowns at several levels – Customers have needs – Customers make requests – Developers provide software
Reuse l A changing of context l …
Change Happens l Let’s design for it
Our Approach l Lots of examples (3 problems, many solutions, today) l Some overarching lessons l Build up an intuition
UML Review: Class Diagrams Class Name Attribute : Type Operation (parameter) : Return Type
UML Review: Class Diagrams Association Generalization Aggregation Composition
A Class Diagram
Example #1: Theseus and the Minotaur l http: //www. logicmazes. com/theseus. html
Original Theseus Design
Original Theseus Design l What if we want to add “Water” ?
Original Theseus Design l What if we want to add “Water” ? ?
Original Theseus Design l What if we want to add “Water” ? ? l How do we fix this?
Tnt. M: Changes l Changing the board size l Adding terrain types l Adding more monsters l Adding a second player l “Intelligent elements”
Tnt. M 2
Tnt. M 2: Object Interfaces & Inheritance
Tnt. M: Changes l Changing the board size l Adding terrain types l Adding more monsters l Adding a second player l “Intelligent elements”
How far is too far? l Changing board size? l Pushable blocks? l Intelligent elements? l Real time gameplay? l Physics challenges?
Tnt. M 2
Bonus! l Stomp. On( stompee ) Or l Stomped. On( stomper )
Aside: Three Degrees of Support l Is it a good solution? l Can they build that solution? l Can that solution be used to make other good solutions?
Example #2 Klax l l Blocks fall from above, use a paddle to catch Deposit blocks in one of 5 columns Try to make lines of 3 in a row or more http: //www. 123 games. dk/game/puzzle/klax 3 d/ klax_eng. php
A Good Klax Design?
Chiron 2 Architectural Style
C 2 Klax
Spelling Klax?
Spelling Klax?
Example #3: Scrabble
Function Overload Changes to rack
Class Overload
(besides missing details)
Is this a good design?
Overengineered? What change are you designing for? Multiple point values for a given tile type? More types of board objects?
Overengineered? Meanwhile: Board doesn’t actually work Populating the tiles is likely a hassle Tilepool vs. Player. current. Tiles Inelegance lead to problems
A Nice Approach?
A Nice Approach?
Scrabble l Can a design accommodate: – Changes to letter values? – Changes to bonus squares? – AI opponents? – Different dictionaries?
Summary l Designing for change is a matter of: – – – l Controlling dependency Proper encapsulation Generalizing where you can Which changes? – – – What are the biggest change risks? What kind of program is this, essentially? Where is “the line”?
Practically: l What is the core we know will be true? – l What variations on that will we see? If there’s something that needs to change: – – Can it be changed in one place? Does anything else need to be changed when it changes? l Can each class ignore its context? l Discipline
Assignment #1 Continued l []
- Week by week plans for documenting children's development
- First order vs second order change
- A case study designing a document editor
- Designing a document editor in design patterns
- What are physical changes
- Absolute change and relative change formula
- Differences between chemical and physical changes
- Change in supply and change in quantity supplied
- Physical vs chemical change examples
- Rocks change due to temperature and pressure change
- Whats the difference between a chemical and physical change
- Fspos
- Typiska drag för en novell
- Tack för att ni lyssnade bild
- Returpilarna
- Varför kallas perioden 1918-1939 för mellankrigstiden?
- En lathund för arbete med kontinuitetshantering
- Adressändring ideell förening
- Tidbok yrkesförare
- A gastrica
- Förklara densitet för barn
- Datorkunskap för nybörjare
- Stig kerman
- Hur skriver man en tes
- Delegerande ledarstil
- Nyckelkompetenser för livslångt lärande
- Påbyggnader för flakfordon
- Vätsketryck formel
- Offentlig förvaltning
- Jag har nigit för nymånens skära
- Presentera för publik crossboss
- Vad är ett minoritetsspråk
- Vem räknas som jude
- Klassificeringsstruktur för kommunala verksamheter
- Fimbrietratt
- Bästa kameran för astrofoto
- Centrum för kunskap och säkerhet
- Lågenergihus nyproduktion
- Mat för unga idrottare
- Verktyg för automatisering av utbetalningar
- Rutin för avvikelsehantering
- Smärtskolan kunskap för livet
- Ministerstyre för och nackdelar
- Tack för att ni har lyssnat
- Vad är referatmarkeringar
- Redogör för vad psykologi är
- Stål för stötfångarsystem
- Tack för att ni har lyssnat
- Borra hål för knoppar
- Orubbliga rättigheter
- Varians
- Tack för att ni har lyssnat
- Steg för steg rita
- Vad är verksamhetsanalys
- Tobinskatten för och nackdelar
- Toppslätskivling dos