CSC323 2010S, Class 15: Extreme Programming (1): Principles, Activities, Practices Overview: * Project Discussion: UML Diagrams. * About XP. Admin: * Crappy swag from SIGCSE * It's Not "National Pipe Cleaner Day" Day * Reading for Thursday: The rest of the XP book. * Sorry for the confusion in last week's class. * EC for Thursday's CS Extra: Drupal. * EC for Friday's CS Table: TBD. Some questions produced by the diagrams * What does the GUI do? * What does the networker do? * What does the network do * How big should boards be? * How do we make a multi-player/competitive version The checkRules() method in the Cell (or CellType or ...) class needs to be able to look at neighbors. How? Some possibilities * Cell has a reference to a Master and a Master has a reference to a Board * Following two references is costly * Cell has a reference to a Board * Permits us to use Flyweight Cell model * Do we permit cyclic references? * checkRules() takes a Board as a parameter * The Cell needs access to the Board, so ... * The Board is unlikely to change, so ... * Might change because of network activity, depending on your game model * You might want to permit multiple boards in the game * A Cell has a reference to its neighbors * Won't work in the Flyweight Cell model * And some of us really want to support that model * Lets us store the cells in something like a multiply-linked list * Requires a lot of duplicate information (could get out of synch) A B C D E F G H I * checkRules takes a list of states as a parameter * Permits us to use Flyweight Cell model * Limits information flow - The cell can't know anything about non-neighbors * Potentially less work * Temporary winner Rule: * V1 * State + list of conditions + result state * Condition: "If N neighbors of State S" * AND of all the conditions * Cell has a list of rules * V2: * Hard-coded rules; To build a new set of rules, you need a new class * V3: * Use Object hierarchy to describe rules * Note: We need a Neighbors class to represent a set of neighbors (it seems a lot like a Dictionary) Other interesting design concepts * Model View Controller (MVC) * Model stores information about the system (the "state" of the system) * The View shows the model and passes events to the controller * The Controller affects the Model * What is a design pattern, anyway? * A generic common theme that works for solving common types of problems * What's the problem that leads us to choose MVC? Extreme Programming * Apology that it changed significantly between 1st ed and 2nd ed * Why the three parts: Values, Principles, Practices? * Strengths * Ideal workspace looks like CCL * Weaknesses * Buzzwords (synergy, teamwork, respect) * Driving metaphor that quickly gets dropped * Useful knowledge * Small iterative chunks can be helpful * The traditional workplace is modeled well by Scott Adams * The standard model of programming is really depressing * Sounds like work is unhappy * Lots of lies * Not much ownership of the product * Etc. * There are a lot of roles in a traditional project, more than just programmers * Testing is your friend * There's no one silver bullet; you need to mix a lot of practices together to succeed, and the practices do interact. * Phases of software development formalized a bit * Audience * Middle management, who likes buzzwords * Also the back cover talks about "your team" * Might convince middle management to treat their programmers better, which leads to better results * Also other managers of small teams (e.g., at small companies) * Programmers themselves (Who are being told to follow these guidelines) * It will make you happier and more productive. * Programmers (who just like to read software design books for fun) * Encourage changing behavior at work (or workplace) (define f (left-section left-section left-section)) Where (define left-section (lambda (g l) (lamda (x) (g l x))))