Informatics 122 Software Design II Lecture 5 Andr

  • Slides: 35
Download presentation
Informatics 122 Software Design II Lecture 5 André van der Hoek & Alex Baker

Informatics 122 Software Design II Lecture 5 André van der Hoek & Alex Baker Duplication of course material for any commercial purpose without the explicit written permission of the professor is prohibited. 05 June 2021 – 11: 18: 55 © 2007 University of California, Irvine – André van der Hoek 1

Today’s Lecture n Finishing up lecture 4 n Evolvability n (If time – let’s

Today’s Lecture n Finishing up lecture 4 n Evolvability n (If time – let’s design Scrabble!) 05 June 2021 – 11: 19: 01 © 2007 University of California, Irvine – André van der Hoek 2

Some Deeper Questions 05 June 2021 – 11: 19: 02 © 2007 University of

Some Deeper Questions 05 June 2021 – 11: 19: 02 © 2007 University of California, Irvine – André van der Hoek 3

Some Deeper Questions 05 June 2021 – 11: 19: 06 © 2007 University of

Some Deeper Questions 05 June 2021 – 11: 19: 06 © 2007 University of California, Irvine – André van der Hoek 4

Some Deeper Questions 05 June 2021 – 11: 19: 09 © 2007 University of

Some Deeper Questions 05 June 2021 – 11: 19: 09 © 2007 University of California, Irvine – André van der Hoek 5

Some Deeper Questions 05 June 2021 – 11: 19: 11 © 2007 University of

Some Deeper Questions 05 June 2021 – 11: 19: 11 © 2007 University of California, Irvine – André van der Hoek 6

Important Points to Observe (Assignment) n Being a “ 1” or a “ 4”

Important Points to Observe (Assignment) n Being a “ 1” or a “ 4” on someone’s ranking is not an absolute evaluation – if you are a “ 1” on someone’s ranking, the other designs may have all been relatively poor – if you are a “ 4” on someone’s ranking, the other designs may have all been relatively stellar n Length of the document seems to be an indicator in peer’s rankings, but not necessarily in ours n It is easier to review than to design n (and, by now, you know it is easier to design or review than it is to implement) 05 June 2021 – 11: 19: 12 © 2007 University of California, Irvine – André van der Hoek 7

Important Points to Observe (UML) n Having a document “heavy on UML” by itself

Important Points to Observe (UML) n Having a document “heavy on UML” by itself is not a guarantee for a great design – it may indeed be more complete – it may also be less understandable n If I cannot find the “flow” in the UML diagram, something tends to be wrong – for some designs, we end up searching for their meaning – for others, it is clear from the diagram v physical layout, often, has something to do with this n Design languages are a factor – UML by itself is not good enough 05 June 2021 – 11: 19: 14 © 2007 University of California, Irvine – André van der Hoek 8

Important Points to Observe (Process) n Where to start? – what about with the

Important Points to Observe (Process) n Where to start? – what about with the set of nouns in the description of the problem (e. g. , word, rack, tile, board, …) – what about with the set of verbs in the description of the problem (e. g. , challenge, play, double, triple, …) n Work towards completeness – does my current design account for all possible features – does it do so explicitly, or are some features hidden n This is merely a rough and rules of thumb process, but one that tends to help the beginning designer 05 June 2021 – 11: 19: 14 © 2007 University of California, Irvine – André van der Hoek 9

A Checklist on Overall Process n Apply rigor n Separate concerns – modularize –

A Checklist on Overall Process n Apply rigor n Separate concerns – modularize – abstract n Anticipate change n Generalize n Work incrementally 05 June 2021 – 11: 19: 21 © 2007 University of California, Irvine – André van der Hoek 10

A Checklist on Overall Design n Strive for grouping related functionality (high cohesion) n

A Checklist on Overall Design n Strive for grouping related functionality (high cohesion) n Strive for ungrouping semi-related functionality (high cohesion) n Strive for reducing interdependency (low coupling) 05 June 2021 – 11: 19: 21 © 2007 University of California, Irvine – André van der Hoek 11

A Checklist on Class Design n Cohesion n Completeness n Convenience n Clarity n

A Checklist on Class Design n Cohesion n Completeness n Convenience n Clarity n Consistency 05 June 2021 – 11: 19: 22 © 2007 University of California, Irvine – André van der Hoek 12

A Checklist on Principles and Strategies n Principles – keep it simple, stupid! (KISS)

A Checklist on Principles and Strategies n Principles – keep it simple, stupid! (KISS) – information hiding – acyclic dependencies – … n Strategies – program to the interface – refactor – apply software patterns – use aspects – … 05 June 2021 – 11: 19: 23 © 2007 University of California, Irvine – André van der Hoek 13

Designing for Change n Looking at designs in the context of changes that might

Designing for Change n Looking at designs in the context of changes that might be made to them – before implementation – after implementation n What elements of design help and hinder making changes? 05 June 2021 – 11: 19: 24 © 2007 University of California, Irvine – André van der Hoek 14

Adding a Computer-Controlled AI Opponent n Are the details that make up what a

Adding a Computer-Controlled AI Opponent n Are the details that make up what a player does well isolated from other parts of the program? 05 June 2021 – 11: 19: 24 © 2007 University of California, Irvine – André van der Hoek 15

05 June 2021 – 11: 19: 26 © 2007 University of California, Irvine –

05 June 2021 – 11: 19: 26 © 2007 University of California, Irvine – André van der Hoek 16

05 June 2021 – 11: 19: 27 © 2007 University of California, Irvine –

05 June 2021 – 11: 19: 27 © 2007 University of California, Irvine – André van der Hoek 17

05 June 2021 – 11: 19: 32 © 2007 University of California, Irvine –

05 June 2021 – 11: 19: 32 © 2007 University of California, Irvine – André van der Hoek 18

Automatic Dictionary Checking n Question two from your design reviews n Is the functionality

Automatic Dictionary Checking n Question two from your design reviews n Is the functionality for determining a legal move well isolated from the rest of the program? 05 June 2021 – 11: 19: 34 © 2007 University of California, Irvine – André van der Hoek 19

05 June 2021 – 11: 19: 35 © 2007 University of California, Irvine –

05 June 2021 – 11: 19: 35 © 2007 University of California, Irvine – André van der Hoek 20

05 June 2021 – 11: 19: 37 © 2007 University of California, Irvine –

05 June 2021 – 11: 19: 37 © 2007 University of California, Irvine – André van der Hoek 21

05 June 2021 – 11: 19: 41 © 2007 University of California, Irvine –

05 June 2021 – 11: 19: 41 © 2007 University of California, Irvine – André van der Hoek 22

05 June 2021 – 11: 19: 43 © 2007 University of California, Irvine –

05 June 2021 – 11: 19: 43 © 2007 University of California, Irvine – André van der Hoek 23

Implementing Upwords n Question 3 from your review forms n How is a space

Implementing Upwords n Question 3 from your review forms n How is a space represented? n Have you made any problematic assumptions elsewhere in your design? 05 June 2021 – 11: 19: 52 © 2007 University of California, Irvine – André van der Hoek 24

05 June 2021 – 11: 19: 53 © 2007 University of California, Irvine –

05 June 2021 – 11: 19: 53 © 2007 University of California, Irvine – André van der Hoek 25

05 June 2021 – 11: 19: 57 © 2007 University of California, Irvine –

05 June 2021 – 11: 19: 57 © 2007 University of California, Irvine – André van der Hoek 26

05 June 2021 – 11: 19: 59 © 2007 University of California, Irvine –

05 June 2021 – 11: 19: 59 © 2007 University of California, Irvine – André van der Hoek 27

05 June 2021 – 11: 20: 00 © 2007 University of California, Irvine –

05 June 2021 – 11: 20: 00 © 2007 University of California, Irvine – André van der Hoek 28

Post-Implementation Space Changes n Question 4 on the review form n Can you change

Post-Implementation Space Changes n Question 4 on the review form n Can you change the locations? n Can you change the amounts of multipliers? n Can you create bonus tiles of a wholly different nature? n At coding stage, a subtle difference 05 June 2021 – 11: 20: 03 © 2007 University of California, Irvine – André van der Hoek 29

05 June 2021 – 11: 20: 04 © 2007 University of California, Irvine –

05 June 2021 – 11: 20: 04 © 2007 University of California, Irvine – André van der Hoek 30

05 June 2021 – 11: 20: 06 © 2007 University of California, Irvine –

05 June 2021 – 11: 20: 06 © 2007 University of California, Irvine – André van der Hoek 31

05 June 2021 – 11: 20: 08 © 2007 University of California, Irvine –

05 June 2021 – 11: 20: 08 © 2007 University of California, Irvine – André van der Hoek 32

Post-Implementation Space Changes n How would we actually do this? 05 June 2021 –

Post-Implementation Space Changes n How would we actually do this? 05 June 2021 – 11: 20: 13 © 2007 University of California, Irvine – André van der Hoek 33

Designing for Change n Anticipating possible changes n Isolating functionality n Avoiding over-generalization or

Designing for Change n Anticipating possible changes n Isolating functionality n Avoiding over-generalization or over-specialization n An intuitive sense that we are helping you build – “something seems wrong about this…” 05 June 2021 – 11: 20: 15 © 2007 University of California, Irvine – André van der Hoek 34

Designing Scrabble n What would a good design, perhaps, look like? 05 June 2021

Designing Scrabble n What would a good design, perhaps, look like? 05 June 2021 – 11: 20: 16 © 2007 University of California, Irvine – André van der Hoek 35