Presentation is loading. Please wait.

Presentation is loading. Please wait.

Design Practices. Design Practices Principles Patterns What are the characteristics of good design? What are good solutions to common design problems?

Similar presentations


Presentation on theme: "Design Practices. Design Practices Principles Patterns What are the characteristics of good design? What are good solutions to common design problems?"— Presentation transcript:

1 Design Practices

2 Design Practices Principles Patterns What are the characteristics of good design? What are good solutions to common design problems? How do we go about design and what do we produce?

3 cs121 design Game User interface Software Test plan ++ This is well underway.

4 But what is design?

5 design: the verb “Design is the planning that lays the basis for the making.” -wikipedia

6 design: the noun “Blueprint, something intended as a guide for making something else.” - google define:design

7 “Plans are worthless. Planning is priceless.” -eisenhower

8 design: the noun “Features of shape, configuration, pattern, or ornamentation that can be judged by the eye in finished products. “ -NASA

9 design a la cs121 noun: a model that captures the essential properties of a thing verb: the practice of “creating” a design to solve some problem

10 verbs: Model ≠ Design Requirements modelsDocumentation project start project end Design models what should it do how will it do ithow is it does it Design is a creative, problem-solving process! Design models are predictive.

11 design create the piece to create the picture

12 how do we go about design? model review (critique) repeat until everyone is happy “enough”

13 Waterfall Model Requirements Design Implementation Test with feedback

14 Iterative Development In each iteration: Identify the objectives of the iteration Design a solution to achieve the objectives Implement the solution Test the implementation we talked about this last time

15 Agile requirements At the start of each iteration: Incorporate new goals (often produced by last iteration) Remove goals no longer needed Reprioritize Clarify requirements for goals at top of stack Plan iteration highest priority goal lowest priority goal

16 Iterative Development In each iteration: Identify the objectives of the iteration Design a solution to achieve the objectives Model solution Review Repeat until good enough Implement the solution Test the implementation

17 agile design design for nowdesign for later

18 agile design design skeletonadd meat early iterations later iterations … don’t expect to get everything right the first time!

19 CS121 project landmarks alphabetav1 stable architecture, stable GUI game for user testingrelease to customer

20 Design Practices Principles Patterns What are the characteristics of good design? What are good solutions to common design problems? How do we go about design and what do we produce?

21 Forms of models Text (hyperlinked) Diagrams, charts, graphs Prototypes Mathematical models

22 Agile models Know your purpose Choose the simplest form that works Know when to throw it away

23 Forms of models Text (hyperlinked) Diagrams, charts, graphs Prototypes Mathematical models GDD

24 Forms of models Text (hyperlinked) Diagrams, charts, graphs Prototypes Mathematical models

25 Unified Modeling Language The UML is a standard language for visualizing, specifying, constructing, and documenting the artifacts of a software system.

26 Domain model Course Course Offering Instructor Student Textbook Time Slot Room Meeting Class List Author Department College Major Building Semester uses written by

27 “Domain” model Player Pacman Screen grid moves Grid Cell positioned on has a Type Level has a lives score

28 Design model Major classes Responsibility of each class Interactions of classes

29 Design model (work in progress) Player Sprite Lives Score Current cell Move() Sprite Level Cells Game Level Cell Blank cellGhost cellDot cell

30 Domain  Design CRC cards: design method for OO –Class –Responsibilities –Collaboration “Act out use cases”

31 CRC Cards Technique (Responsibility-Driven Design) Informal, non-detailed Used for group brain-storming End result is a first cut at design model Not intended to provide a complete design

32 The Basic Idea Develop set of index cards. Each card represents one design class. A card contains: –The name of the class. –The responsibilities of the class. –Collaborations: other classes with which this class interacts and its responsibilities in the interaction

33 Format of CRC cards Responsibilities ___________ ____________ Class Name super class sub-classes Collaborations ____________ Limiting the size of a card is an attempt at preventing the class from becoming too complex.

34 Pac Man move use case Move: 1.Player moves Pac Man left, right, up, down 2.Pac Man moves to new space 2aAttempted move prohibited by wall, no movement 3.New space is blank 3a.New space has dot but not last dot, 50 points awarded 3b. New space has last dot, 50 points awarded, new level starts 3c. New space has ghost, life decreases by 1, if last life game ends

35 “Domain” model Player Pacman Screen grid moves Grid Cell positioned on has a Type Level has a lives score

36 Domain classes Player Pacman Score Lives Level Screen grid Grid Cell Cell type

37 Player CRC card Player Class

38 Player CRC card Player super class: sub-classes: Super- and Sub-classes if any

39 Player CRC card Move Remember score Remember number of lives Player Responsibilities

40 Player CRC card Move Remember score Remember number of lives Player Collaborations collaborate with ?

41 “Domain” model Player Pacman Screen grid moves Grid Cell positioned on has a Type Level has a lives score

42 Responsibilities Player Pacman Score Lives Level Screen grid Grid Cell Cell type remember current cell, draw self

43 Responsibilities Player Pacman Score Lives Level Screen grid Grid Cell Cell type maybe these should be “attributes” of the player class rather than proper classes

44 Attribute vs. Collaboration An object of a class typically has one or more attributes. Attributes have values that specify or describe the object. A value might or might not deserve the distinction of being an object itself. A would-be attribute that is object-valued is actually a collaboration.

45 Design model: how does move work? Player Sprite Lives Score Current cell Move() Sprite Level Cells Game Level Cell position Blank cellGhost cellDot cell

46 Design model: how does move work? Player Sprite Lives Score Position Move() Sprite Level Cells Game Level Cell position Blank cellGhost cellDot cell

47 Design model: how does move work? Player Sprite Lives Score Move() Sprite Level Cells Current cell Game Level Cell position Blank cellGhost cellDot cell

48 How to decide Design principles Design patterns

49 Design class models attributes responsibilities Student ID registers name

50 Class models Our models evolve... data methods Student int ID void registers() name

51 Class models: aggregation/composition Student int ID course courseList void registers() Course course ID “has a” 1,…

52 Class model: Inheritance Student int ID void registers() Part Time Student int ID void registers() Full Time Student int ID void registers()

53 Use case realization: Sequence diagram StudentRegistrarCourse list register( int classID)course.stillOpen(classID) true …

54 Design classesSoftware classes implement UML documents

55 UML Capture important classes, responsibilities, collaborations Often omit unnecessary detail: –e.g. helper classes like lists

56 Classification of UML User model view –use case diagrams Structural model view –class diagrams –object diagrams Behavioral model view –sequence diagrams –collaboration diagrams –state machine diagrams –activity diagrams Implementation model view –component diagrams Environment model view –deployment diagrams

57 Forms of models Text (hyperlinked) Diagrams, charts, graphs Prototypes Software (e.g. proofs of concepts) Mathematical models good form for “testing” design

58 Prototypes Communicate “These are the basics of the game…”

59 Prototypes Communicate Resolve technical risks “We know how to detect collisions.”

60 Prototypes Communicate Resolve technical risks Evaluate/test “This is how the screens will look. What do you think?”

61 Prototypes Communicate Resolve technical risks Evaluate/test Iterative design/development strategy Prototype 1Prototype 0 Prototype n = v.1 …

62 Agile modeling principles Know your purpose Choose the simplest form that works Know when to throw it away These apply to prototypes

63 Prototyping principles Know your purpose Make concrete your vision for the customer Is our core gameplay fun? Is pygame collision detection fast enough?

64 Prototyping principles Know your purpose and expected outcomes Make concrete your vision for the customer. Verbal feedback. Is our core gameplay fun? User questionnaire. Is pygame collision detection fast enough? Calculate FPS vs. # sprites (50x50) in full screen mode.

65 Prototyping principles Know your purpose and expected outcomes Choose the simplest form that works

66 Prototyping principles Know your purpose and expected outcomes Choose the simplest form that works UI mockups storyboards

67 Prototyping principles Ask a question Devise a test protocol or metric Choose the simplest form that works software executables (try prototyping tools like Gamemaker and pygame)

68 Prototyping principles Ask a question Devise a test protocol or metric Choose the simplest form that works Know when to throw it away

69 Prototyping principles Ask a question Devise a test protocol or metric Choose the simplest form that works Know when to throw it away or refactor change the internal structure without affecting the external behavior

70 Mathematical Models Algebraic models: i.e. FPS(# sprites) Combinatoric models: i.e. #winning strategies Probabilistic models: i.e. Prob(A wins | weapons of A and B) Simulation

71 how do we go about design? model review (critique) repeat Next time: Formal design reviews

72 Next time Design reviews Intro to Design principles


Download ppt "Design Practices. Design Practices Principles Patterns What are the characteristics of good design? What are good solutions to common design problems?"

Similar presentations


Ads by Google