Design Practices Design Practices Principles Patterns How do
- Slides: 72
Design Practices
Design • Practices • Principles • Patterns How do we go about design and what do we produce? What are the characteristics of good design? What are good solutions to common design problems?
cs 121 design • • • Game User interface Software Test plan ++ This is well underway.
But what is design?
design: the verb “Design is the planning that lays the basis for the making. ” -wikipedia
design: the noun “Blueprint, something intended as a guide for making something else. ” - google define: design
“Plans are worthless. Planning is priceless. ” -eisenhower
design: the noun “Features of shape, configuration, pattern, or ornamentation that can be judged by the eye in finished products. “ -NASA
design a la cs 121 • noun: a model that captures the essential properties of a thing • verb: the practice of “creating” a design to solve some problem
verbs: Model ≠ Design Requirements models what should it do project start Design models how will it do it Documentation how is it does it project end Design is a creative, problem-solving process! Design models are predictive.
design create the piece to create the picture
how do we go about design? • model • review (critique) • repeat until everyone is happy “enough”
Waterfall Model with feedback Requirements Design Implementation Test
Iterative Development In each iteration: • • we talked about this last time Identify the objectives of the iteration Design a solution to achieve the objectives Implement the solution Test the implementation
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
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
agile design for now design for later
agile design skeleton early iterations … add meat later iterations don’t expect to get everything right the first time!
CS 121 project landmarks alpha stable architecture, stable GUI beta v 1 game for user testing release to customer
Design • Practices • Principles • Patterns How do we go about design and what do we produce? What are the characteristics of good design? What are good solutions to common design problems?
Forms of models • • Text (hyperlinked) Diagrams, charts, graphs Prototypes Mathematical models
Agile models • Know your purpose • Choose the simplest form that works • Know when to throw it away
Forms of models • • Text (hyperlinked) Diagrams, charts, graphs Prototypes Mathematical models GDD
Forms of models • Text (hyperlinked) • Diagrams, charts, graphs • Prototypes • Mathematical models
Unified Modeling Language The UML is a standard language for visualizing, specifying, constructing, and documenting the artifacts of a software system.
Domain model Room Meeting Building Instructor Department Course Offering Course College Major uses Time Slot Textbook written by Semester Author Class List Student
“Domain” model lives score Player moves Pacman Level positioned on has a Screen grid has a Grid Cell Type
Design model • Major classes • Responsibility of each class • Interactions of classes
Design model (work in progress) Player Sprite Lives Score Current cell Move() Game Level Sprite Level Cells Cell Blank cell Ghost cell Dot cell
Domain Design CRC cards: design method for OO – Class – Responsibilities – Collaboration “Act out use cases”
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
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
Format of CRC cards Class Name super class sub-classes Responsibilities Collaborations ____________ ____________ Limiting the size of a card is an attempt at preventing the class from becoming too complex.
Pac Man move use case Move: 1. Player moves Pac Man left, right, up, down 2. Pac Man moves to new space 2 a Attempted move prohibited by wall, no movement 3. New space is blank 3 a. New space has dot but not last dot, 50 points awarded 3 b. New space has last dot, 50 points awarded, new level starts 3 c. New space has ghost, life decreases by 1, if last life game ends
“Domain” model lives score Player moves Pacman Level positioned on has a Screen grid has a Grid Cell Type
Domain classes • • Player Pacman Score Lives Level Screen grid Grid Cell type
Player CRC card Class Player
Player CRC card Player super class: sub-classes: Super- and Sub-classes if any
Player CRC card Player Move Responsibilities Remember score Remember number of lives
Player CRC card Player Move Remember score Remember number of lives collaborate with ? Collaborations
“Domain” model lives score Player moves Pacman Level positioned on has a Screen grid has a Grid Cell Type
Responsibilities • • Player Pacman Score Lives Level Screen grid Grid Cell type remember current cell, draw self
Responsibilities • • Player Pacman Score Lives Level Screen grid Grid Cell type maybe these should be “attributes” of the player class rather than proper classes
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.
Design model: how does move work? Player Sprite Lives Score Current cell Move() Game Level Sprite Cell position Level Cells Blank cell Ghost cell Dot cell
Design model: how does move work? Player Sprite Lives Score Position Move() Game Level Sprite Cell position Level Cells Blank cell Ghost cell Dot cell
Design model: how does move work? Player Sprite Lives Score Move() Game Level Sprite Cell position Level Cells Current cell Blank cell Ghost cell Dot cell
How to decide • Design principles • Design patterns
Design class models name Student attributes ID registers responsibilities
Class models Our models evolve. . . name Student data int ID void registers() methods
Class models: aggregation/composition Student int ID course. List void registers() “has a” Course course ID 1, …
Class model: Inheritance Student int ID void registers() Full Time Student Part Time Student int ID void registers()
Use case realization: Sequence diagram Student Registrar register( int class. ID) … Course list course. still. Open(class. ID) true
Design classes Software classes implement UML documents
UML • Capture important classes, responsibilities, collaborations • Often omit unnecessary detail: – e. g. helper classes like lists
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
Forms of models • • • Text (hyperlinked) Diagrams, charts, graphs good form for “testing” design Prototypes Software (e. g. proofs of concepts) Mathematical models
Prototypes • Communicate “These are the basics of the game…”
Prototypes • Communicate • Resolve technical risks “We know how to detect collisions. ”
Prototypes • Communicate • Resolve technical risks • Evaluate/test “This is how the screens will look. What do you think? ”
Prototypes • • Communicate Resolve technical risks Evaluate/test Iterative design/development strategy Prototype 0 Prototype 1 … Prototype n = v. 1
Agile modeling principles • Know your purpose • Choose the simplest form that works • Know when to throw it away These apply to prototypes
Prototyping principles • Know your purpose Make concrete your vision for the customer Is our core gameplay fun? Is pygame collision detection fast enough?
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 (50 x 50) in full screen mode.
Prototyping principles • Know your purpose and expected outcomes • Choose the simplest form that works
Prototyping principles • Know your purpose and expected outcomes • Choose the simplest form that works UI mockups storyboards
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)
Prototyping principles • • Ask a question Devise a test protocol or metric Choose the simplest form that works Know when to throw it away
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
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
how do we go about design? • model • review (critique) • repeat Next time: Formal design reviews
Next time • Design reviews • Intro to Design principles
- Dating serves several important functions that include
- Associations and correlations in data mining
- Tourism principles practices philosophies
- Sdlc principles and practices
- Project management principles and practices
- Florida real estate principles practices & law
- Broadcasting principles and practices
- Involuntary inactive real estate license florida
- Security program and policies principles and practices
- Project management principles and practices
- 8 principles of evidence based practices
- Change management principles and practices
- Federal agencies milady
- Current issues in classroom testing
- Florida real estate principles practices & law
- Florida real estate principles practices
- Security program and policies principles and practices
- Florida real estate principles practices
- Example of no brokerage relationship
- Security program and policies principles and practices
- Security program and policies principles and practices
- What is this
- Language assessment: principles and classroom practices
- Risk management principles and practices
- Corrupted size vs. prev_size:
- Corporate governance principles policies and practices
- Elements of design in interior design ppt
- Pattern using line
- Reusable components in java
- Design patterns slides
- Hacker space design patterns
- Erich gamma
- Factory design pattern android
- Peter norvig design patterns
- A case study designing a document editor
- Structural design patterns in java
- Grasp design patterns
- Secure design patterns
- Patterns in game design
- Multithreading design patterns
- Behavioral design patterns
- Hci design patterns
- Design patterns summary
- Guest circulation pattern
- Behavior design pattern
- Strategy pattern
- Pure fabrication domain model
- Parallel design patterns
- Software posa
- Traffic patterns interior design
- Parallel design patterns
- Unit test design patterns
- Types of design
- Design patterns software engineering
- Software architecture patterns
- Wpf design patterns
- Secure design patterns
- Creational design pattern
- Atomic design pattern
- Structural design patterns
- Move in a circular or semi-circular direction
- Sql design patterns
- What is a traffic pattern in interior design
- Grasp object oriented design
- Game programming patterns robert nystrom
- Design patterns summary
- A case study designing a document editor
- Bpm design patterns
- Azure data factory features
- Oracle data warehouse best practices
- What is graduated rhythm
- Principle of input design
- 11 principles of design