COMP 304B Object-Oriented Software Design -- Assignment 6

COMP 304B Object-Oriented Software Design - Assignment 6
  Due date: Wednesday April 11th, 2007 before 23:55

 

Practical information

The assignment

In this assignment, you will implement part of the multi-view functionality of Ultimate Sudoku, a Sudoku game, by means of the Observer Pattern. Note that you will not implement actual game logic, only the multi-view capability.

When the application starts, you are presented with a control panel. The control panel allows you to open up specific views of the Sudoku board. These views allow a player to focus on a particular area of the board. The offset of a particular view from the top-left corner of the full board is shown as the window name.

Players can enter values (1 - 9) in cells, on any view. They do this by first clicking on a cell, which selects it (and turns the background grey). When a new value is entered, all the appropriate views need to be updated. This means data is stored in a central location to which views are attached. The beginning of a central SudokuBoardState is provided to store this central data. Note that when the board is updated, only the affected views should be notified. You should use the pull variant of the Observer Pattern.

As shown above, the code you are given as a starting point provides basic display functionality. To clarify the (row, column) coordinates used, it displays coordinates in cells. Note that these coordinates are "local" to the view. One needs to add the offset of the view to these coordinates to obtain the corresponding central coordinates. The displayed coordinates are just for clarification and should not be shown in your solution. Your solution should start with blank cells.

Design

You should provide two UML diagrams:

  1. A Class Diagram of your solution. This diagram should include all components of your solution, including your GUI classes. Of course, you don't need to draw classes from libraries, such a Tkinter.
  2. A Sequence Diagram of what happens when a player enters a new value in one of the views when two views are open. This should include notification of views and the updating of objects.

Implementation

Your Sudoku game must be implemented in Python. The starting point for this assignment is found in Sudoku.zip.


Hans Vangheluwe & Alexandre Denault, March 2008