Week 2 Design Examples and Designing for Change - PowerPoint PPT Presentation

About This Presentation
Title:

Week 2 Design Examples and Designing for Change

Description:

An implementation design describes a path from system design to the ... Adding more monsters. Adding a second player 'Intelligent elements' How far is too far? ... – PowerPoint PPT presentation

Number of Views:89
Avg rating:3.0/5.0
Slides: 36
Provided by: alexb6
Learn more at: https://ics.uci.edu
Category:

less

Transcript and Presenter's Notes

Title: Week 2 Design Examples and Designing for Change


1
Week 2Design Examples andDesigning for Change
  • Alex Baker

2
Implementation Design
  • An implementation design is a road map
  • understandable, unambiguous, consistent, helpful,
  • An implementation design describes a path from
    system design to the outcome
  • correct, complete, concise, verifiable,
    effective,
  • An implementation design describes what the
    implementers should do
  • elegant, partitionable, recomposable, resilient,
  • An implementation design is a guide towards
    future change
  • evolvable,

3
Emphasis on Changability
  • Change abounds
  • During design
  • During coding
  • Upon delivery
  • After use
  • Reuse for later projects

4
Emphasis Changability
  • Subtle
  • Requires foresight and careful balancing
  • An implementation design describes what the
    implementers should do
  • elegant, partitionable, recomposable, resilient,
  • An implementation design is a guide towards
    future change
  • evolvable,

5
Changability Basic Principles
  • Low Coupling Reducing interdependency
  • Changes dont propagate
  • Reuse is facilitated
  • High Cohesion Grouping functionality
  • Easier to find things
  • Metaphor guides decisions
  • Information Hiding

6
The Ideal Program
vs.

7
A Very Simple Example
  • A sorted list class with
  • getArray() Array
  • getElementAt(int i) Element

8
A Very Simple Example
  • A List class with
  • getArray() Array
  • getElementAt(int i) Element
  • Its too slow, so we switch to a hash table
  • Everywhere you call getArray needs changing
  • Only List is changed
  • Little things like this add up

9
UML Review Class Diagrams
  • Class Name

Attribute Type
Attribute Type
Operation (parameter) Return Type
Operation (parameter) Return Type
Operation (parameter) Return Type
10
UML Review Class Diagrams
  • Association

Generalization
Aggregation
Composition
11
A Class Diagram
12
Example 1 Theseus and the Minotaur
  • http//www.logicmazes.com/theseus.html

13
Original Theseus Design
14
Original Theseus Design
  • What if we want to add Water ?

15
Original Theseus Design
  • What if we want to add Water ?

?
16
Original Theseus Design
  • What if we want to add Water ?
  • How do we fix this?

?
17
TntM Changes
  • Changing the board size
  • Adding terrain types
  • Adding more monsters
  • Adding a second player
  • Intelligent elements

18
TntM 2
19
TntM 2 Object Interfaces Inheritance
20
TntM Changes
  • Changing the board size
  • Adding terrain types
  • Adding more monsters
  • Adding a second player
  • Intelligent elements

21
How far is too far?
  • Changing board size?
  • Pushable blocks?
  • Intelligent elements?
  • Real time gameplay?
  • Physics challenges?

22
Bonus!
  • StompOn( stompee )
  • Or
  • StompedOn( stomper )

23
Example 2 Klax
  • 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.123games.dk/game/puzzle/klax3d/klax_eng
    .php

24
A Good Klax Design?
25
Chiron 2 Architectural Style
26
C2 Klax
27
Spelling Klax?
28
Spelling Klax?
29
Scrabble?
  • How did you design for change?

30
Scrabble?
  • How did you design for change?
  • Could you redesign / refactor for
  • Changes to letter values?

31
Scrabble?
  • How did you design for change?
  • Could you redesign / refactor for
  • Changes to letter values?
  • Changes to bonus squares?

32
Scrabble?
  • How did you design for change?
  • Could you redesign / refactor for
  • Changes to letter values?
  • Changes to bonus squares?
  • AI opponents?

33
Scrabble?
  • How did you design for change?
  • Could you redesign / refactor for
  • Changes to letter values?
  • Changes to bonus squares?
  • AI opponents?
  • Different dictionaries?

34
Summary
  • Designing for change is a matter of
  • Controlling dependency
  • Proper encapsulation
  • Generalizing where you can
  • More broadly, you are asking
  • What are the biggest change risks?
  • What kind of program is this, essentially?
  • Where is the line?

35
Assignment 1 Continued
  • Well exchange designs now
  • Review forms will be online tonight
  • Send completed forms to Andre and I
  • abaker_at_ics.uci.edu
  • andre_at_ics.uci.edu
  • Due 600 pm, Sunday
Write a Comment
User Comments (0)
About PowerShow.com