Informatics 122 Software Design II Lecture 2 Andr

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

Informatics 122 Software Design II Lecture 2 André van der Hoek & Alex Baker Duplication of course material for any commercial purpose without the explicit written permission of the professor is prohibited. 23 October 2021 – 02: 19: 22 © 2010 University of California, Irvine – André van der Hoek 1

Today’s Lecture n Design aesthetics n Assignment 1 23 October 2021 – 02: 19:

Today’s Lecture n Design aesthetics n Assignment 1 23 October 2021 – 02: 19: 23 © 2010 University of California, Irvine – André van der Hoek 2

Aesthetics “a particular theory or conception of beauty or art : a particular taste

Aesthetics “a particular theory or conception of beauty or art : a particular taste for or approach to what is pleasing to the senses and especially sight” [Merriam-Webster] 23 October 2021 – 02: 19: 23 © 2010 University of California, Irvine – André van der Hoek 3

Design Aesthetics n What makes a given software implementation design “beautiful”? n What is

Design Aesthetics n What makes a given software implementation design “beautiful”? n What is it that makes someone appreciate a particular software implementation design? n What are the qualities that determine whether a particular software implementation design is “good” or “bad”? n What is it, then, that we can strive for in creating a software implementation design that will help others in appreciating it? 23 October 2021 – 02: 19: 23 © 2010 University of California, Irvine – André van der Hoek 4

Design Aesthetics n Some brainstorming… 23 October 2021 – 02: 19: 24 © 2010

Design Aesthetics n Some brainstorming… 23 October 2021 – 02: 19: 24 © 2010 University of California, Irvine – André van der Hoek 5

Design Aesthetics n Different people will have a different aesthetic appreciation of different designs

Design Aesthetics n Different people will have a different aesthetic appreciation of different designs – as informed by their own, pre-existing knowledge – as informed by their own understanding of the design goals – as informed by their own ideas n Different roles in the software development project may have different aesthetic appreciation of different designs – – – coder software performance engineer software maintenance specialist software tester … 23 October 2021 – 02: 19: 24 © 2010 University of California, Irvine – André van der Hoek 6

Design Aesthetics n Subjective, as it should be Final Design Alternative Designs Product Designers

Design Aesthetics n Subjective, as it should be Final Design Alternative Designs Product Designers Stakeholders Users Experiences 23 October 2021 – 02: 19: 24 © 2010 University of California, Irvine – André van der Hoek 7

Design Aesthetics n Subjective, as it should be n But we need some kind

Design Aesthetics n Subjective, as it should be n But we need some kind of shared “language”, some common touchstones that we can use to: – understand the underlying implications of certain designs – understand the intentions of designers – effectively frame our communication about designs 23 October 2021 – 02: 19: 24 © 2010 University of California, Irvine – André van der Hoek 8

Shared Design Aesthetics Individual Project Organization School of Thought Community 23 October 2021 –

Shared Design Aesthetics Individual Project Organization School of Thought Community 23 October 2021 – 02: 19: 25 © 2010 University of California, Irvine – André van der Hoek 9

But… n …what kind of shared understandings exist? n …where do these shared understandings

But… n …what kind of shared understandings exist? n …where do these shared understandings come from? 23 October 2021 – 02: 19: 26 © 2010 University of California, Irvine – André van der Hoek 10

Purpose of Implementation Design n An implementation design is a road map n An

Purpose of Implementation Design n An implementation design is a road map n An implementation design describes a path from application / interaction / architecture design to the product n An implementation design describes what the implementers should do n An implementation design is a guide towards future change 23 October 2021 – 02: 19: 26 © 2010 University of California, Irvine – André van der Hoek 11

Purpose of Implementation Design n An implementation design is a road map – understandable,

Purpose of Implementation Design n An implementation design is a road map – understandable, unambiguous, consistent, helpful, … n An implementation design describes a path from application / interaction / architecture design to the product – correct, complete, concise, verifiable, effective, … n An implementation design describes what the implementers should do – elegant, partitionable, recomposable, resilient, … n An implementation design is a guide towards future change – evolvable, … 23 October 2021 – 02: 19: 27 © 2010 University of California, Irvine – André van der Hoek 12

More of a Shared Understanding (Not Perfect!) n An implementation design is a road

More of a Shared Understanding (Not Perfect!) n An implementation design is a road map – understandable, unambiguous, consistent, helpful, … n An implementation design describes a path from application / interaction / architecture design to the product – correct, complete, concise, verifiable, effective, … n An implementation design describes what the implementers should do – elegant, partitionable, recomposable, resilient, … n An implementation design is a guide towards future change – evolvable, … 23 October 2021 – 02: 19: 29 © 2010 University of California, Irvine – André van der Hoek 13

Less of a Shared Understanding n An implementation design is a road map –

Less of a Shared Understanding n An implementation design is a road map – understandable, unambiguous, consistent, helpful, … n An implementation design describes a path from application / interaction / architecture design to the product – correct, complete, concise, verifiable, effective, … n An implementation design describes what the implementers should do – elegant, partitionable, recomposable, resilient, … n An implementation design is a guide towards future change – evolvable, … 23 October 2021 – 02: 19: 29 © 2010 University of California, Irvine – André van der Hoek 14

Approaches to Date n Enumerate objectives n Define principles n Provide strategies 23 October

Approaches to Date n Enumerate objectives n Define principles n Provide strategies 23 October 2021 – 02: 19: 29 © 2010 University of California, Irvine – André van der Hoek 15

Approaches to Date n Enumerate objectives – overall process – overall design – individual

Approaches to Date n Enumerate objectives – overall process – overall design – individual classes n Define principles n Provide strategies 23 October 2021 – 02: 19: 29 © 2010 University of California, Irvine – André van der Hoek 16

Objectives for Overall Process n Apply rigor n Separate concerns – modularize – abstract

Objectives for Overall Process n Apply rigor n Separate concerns – modularize – abstract n Anticipate change n Generalize n Work incrementally 23 October 2021 – 02: 19: 30 © 2010 University of California, Irvine – André van der Hoek 17

Objectives for Overall Design n Strive for grouping related functionality (high cohesion) n Strive

Objectives for 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) 23 October 2021 – 02: 19: 30 © 2010 University of California, Irvine – André van der Hoek 18

Objectives for Class Design n Cohesion n Completeness n Convenience n Clarity n Consistency

Objectives for Class Design n Cohesion n Completeness n Convenience n Clarity n Consistency 23 October 2021 – 02: 19: 30 © 2010 University of California, Irvine – André van der Hoek 19

Approaches to Date n Enumerate objectives n Define principles – keep it simple, stupid!

Approaches to Date n Enumerate objectives n Define principles – keep it simple, stupid! (KISS) – information hiding – acyclic dependencies – … n Provide strategies 23 October 2021 – 02: 19: 31 © 2010 University of California, Irvine – André van der Hoek 20

Keep It Simple, Stupid! (KISS) n Nothing should be more complicated than absolutely essential

Keep It Simple, Stupid! (KISS) n Nothing should be more complicated than absolutely essential and, even then, everything should be analyzed as to whether it can be done simpler 23 October 2021 – 02: 19: 31 © 2010 University of California, Irvine – André van der Hoek 21

Information Hiding n Hide design decisions that are most likely to change, thereby protecting

Information Hiding n Hide design decisions that are most likely to change, thereby protecting other parts of the program from change if the design decision is changed 23 October 2021 – 02: 19: 32 © 2010 University of California, Irvine – André van der Hoek 22

Acyclic Dependencies n Structure packages (grouping classes and interfaces) of a software system in

Acyclic Dependencies n Structure packages (grouping classes and interfaces) of a software system in such a manner that the dependencies among them form a directed acyclic graph (DAG) 23 October 2021 – 02: 19: 32 © 2010 University of California, Irvine – André van der Hoek 23

Approaches to Date n Enumerate objectives n Define principles n Provide strategies – program

Approaches to Date n Enumerate objectives n Define principles n Provide strategies – program to the interface – refactor – apply software patterns – use aspects 23 October 2021 – 02: 19: 32 © 2010 University of California, Irvine – André van der Hoek 24

Program to the Interface n Program to an interface, never directly to an implementation

Program to the Interface n Program to an interface, never directly to an implementation n Always wrap a class in an interface 23 October 2021 – 02: 19: 32 © 2010 University of California, Irvine – André van der Hoek 25

Refactor n (to be discussed in future lectures) 23 October 2021 – 02: 19:

Refactor n (to be discussed in future lectures) 23 October 2021 – 02: 19: 33 © 2010 University of California, Irvine – André van der Hoek 26

Apply Software Patterns n (to be discussed in future lectures) 23 October 2021 –

Apply Software Patterns n (to be discussed in future lectures) 23 October 2021 – 02: 19: 33 © 2010 University of California, Irvine – André van der Hoek 27

Use Aspects n (discussed in Informatics 102) 23 October 2021 – 02: 19: 33

Use Aspects n (discussed in Informatics 102) 23 October 2021 – 02: 19: 33 © 2010 University of California, Irvine – André van der Hoek 28

Approaches to Date n Enumerate objectives n Define principles n Provide strategies 23 October

Approaches to Date n Enumerate objectives n Define principles n Provide strategies 23 October 2021 – 02: 19: 33 © 2010 University of California, Irvine – André van der Hoek 29

Purpose of Implementation Design n An implementation design is a road map – understandable,

Purpose of Implementation Design n An implementation design is a road map – understandable, unambiguous, consistent, helpful, … n An implementation design describes a path from application / interaction / architecture design to the product – correct, complete, concise, verifiable, effective, … n An implementation design describes what the implementers should do – elegant, partitionable, recomposable, resilient, … n An implementation design is a guide towards future change – evolvable, … 23 October 2021 – 02: 19: 34 © 2010 University of California, Irvine – André van der Hoek 30

Purpose of Implementation Design n An implementation design is a road map – understandable,

Purpose of Implementation Design n An implementation design is a road map – understandable, unambiguous, consistent, helpful, … n An implementation design describes a path from application / interaction / architecture design to the product – correct, complete, concise, verifiable, effective, … n An implementation design describes what the implementers should do – elegant, partitionable, recomposable, resilient, … n An implementation design is a guide towards future change – evolvable, … The approaches to date help, but much more remains to be done 23 October 2021 – 02: 19: 34 © 2010 University of California, Irvine – André van der Hoek 31

Why Aesthetics? n Aesthetics aims higher than “usable” or “complete” or … n It

Why Aesthetics? n Aesthetics aims higher than “usable” or “complete” or … n It aims to set a bar for design for which we as professional designers should strive – designs that are elegant – designs that communicate their intent seamlessly – designs that overall exude an air of sophistication that sets them apart from ordinary designs – designs that others will appreciate, for the right reasons 23 October 2021 – 02: 19: 35 © 2010 University of California, Irvine – André van der Hoek 32

First Assignment: Be. Numbered (Overview) n Your client reminisces about the game Bejeweled 2,

First Assignment: Be. Numbered (Overview) n Your client reminisces about the game Bejeweled 2, wherein you switch pairs of jewels to try to create sequences of 3, 4, and 5 jewels, but wishes to experiment with more challenging rules n You are to create a UML, object-oriented design for a software implementation of a rough remake of Bejeweled 2, called Be. Numbered Bejeweled 2 Screenshot 23 October 2021 – 02: 19: 35 © 2010 University of California, Irvine – André van der Hoek 33

First Assignment: Be. Numbered (Rules) n The game takes place on a 8 x

First Assignment: Be. Numbered (Rules) n The game takes place on a 8 x 8 grid, with each cell initially assigned a random number from 1 to 7 n At each turn, the player chooses two adjacent cells (e. g. , two vertically above each other or two horizontally next to each other) – the numbers in those cells are swapped only if the result makes a desired sequence of 3, 4, or 5 numbers in a row, either horizontally or vertically v (with some moves, it is possible to create more than one such sequence, sometimes even involving the same cell) – the cells containing the sequence(s) of numbers are emptied, and the numbers above it fall down, with new empty cells at the top of the grid filled in with new random numbers from 1 to 7 v (this may produce new sequences that undergo the same treatment of being removed, triggering new numbers, etc. ) n When a sequence of 4 is removed, a power number (equivalent in its behavior to the “power gem” in Bejeweled 2) is also inserted n When a sequence of 5 is removed, a magic number (equivalent in its behavior to the “hypercube” in Bejeweled 2) is also inserted 23 October 2021 – 02: 19: 36 © 2010 University of California, Irvine – André van der Hoek 34

First Assignment: Be. Numbered (Rules) n The game has two modes – in regular

First Assignment: Be. Numbered (Rules) n The game has two modes – in regular mode, a desired sequence is a linear sequence (e. g. , 1 -2 -3, 4 -3 -2, 3 -4 -5 -6 -7) – in advanced mode, a desired sequence is any valid mathematical expression using + and –, with the last number being the outcome (e. g. , 1+2=3, 42=2, 3+1+7 -6=5) 23 October 2021 – 02: 19: 36 © 2010 University of California, Irvine – André van der Hoek 35

First Assignment: Be. Numbered (Rules) n Scoring is incremental: – the first sequence of

First Assignment: Be. Numbered (Rules) n Scoring is incremental: – the first sequence of 3 removed in a turn is worth 10 points, each sequence also removed in that turn is worth 10 more than the previous removed sequence – the first sequence of 4 removed in a turn is worth 25 points, each sequence also removed in that turn is worth 25 more than the previous removed sequence – the first sequence of 5 removed in a turn is worth 75 points, each sequence also removed in that turn is worth 75 more than the previous removed sequence n The game consists of three levels, each level ending when the player reaches 1, 000 points n The player loses if no more swaps can be made n The player wins if they successfully complete all three levels 23 October 2021 – 02: 19: 37 © 2010 University of California, Irvine – André van der Hoek 36

First Assignment: Be. Jeweled 2 (Inspiration) n http: //www. popcap. com/games/free/bejeweled 2 23 October

First Assignment: Be. Jeweled 2 (Inspiration) n http: //www. popcap. com/games/free/bejeweled 2 23 October 2021 – 02: 19: 37 © 2010 University of California, Irvine – André van der Hoek 37

First Assignment: Be. Numbered (Other details) n Graphics may be done as text output,

First Assignment: Be. Numbered (Other details) n Graphics may be done as text output, you do not need to worry about building complex designs for the GUI n Other game design decisions, such as how levels differ, the exact randomizer used, or points for power and magic numbers, are up to you n The customer is not sure what will make the game challenging to them, and may demand different rules by which a sequence of numbers is removed, non-number obstacles of sorts, or other changes in the future 23 October 2021 – 02: 19: 38 © 2010 University of California, Irvine – André van der Hoek 38

First Assignment: Be. Numbered (Assignment Details) n You should provide additional documentation beyond the

First Assignment: Be. Numbered (Assignment Details) n You should provide additional documentation beyond the raw UML diagrams, where needed n You should feel free to use any UML or diagramming tool n You should bring one printed copy of your design to class n This is merely part 1 of this assignment, it will continue for several more lectures – you will be evaluating and implementing each other’s designs n Due: January 12 th, start of class 23 October 2021 – 02: 19: 38 © 2010 University of California, Irvine – André van der Hoek 39

First Assignment: Grading n Understandability – can someone pick it up and implement it?

First Assignment: Grading n Understandability – can someone pick it up and implement it? n Flexibility – can the design support future changes? 23 October 2021 – 02: 19: 38 © 2010 University of California, Irvine – André van der Hoek 40