R-Mancala Srinivas Krishnan & Kiranjit Sidhu
Outline Design Details Refactoring Experience Demo
Product Development Process We followed XP’s design principle Less Paper more Code!!! Released minor versions with regression testing using Eclipse Refactored using patterns based on coupling between classes Modular builds using Java packages, again each module was tested using JUnit.
Infrastructure Used Used Eclipse as our base IDE and testing platform Side by Side pair programming Development on windows platform with Java 1.5
Design Details Four Main Packages
Networking States We created a simple protocol for the setup and teardown of remote mancala PLAY GET SENT + cell CLIENTSERVER
Network Design Multithreaded networking package Synchronization between the two games provided using a Send-Response protocol Processing was local on the remote machines Race Conditions, we handled it using timeouts on sockets and the Observer pattern Deadlocks were prevented by making moves only on a SENT. Requests were sent out as GET and the interface was unlocked only if a GET was received This was the case even if a turn comes back to the same player
Refactoring GUI classes were getting too big and bulky We needed an easier way of updating the different views Enter: Observer pattern with MVC Used Java Observer, Observable to implement a simple Model View Controller
Refactoring (cont) MVC The model was the Mancala board and surrounding logic. Updates were made to the model based on the changes to the Control object. Response relayed internally to View and updated. Prevents sleep of the Swing Event Thread.
Refactoring (cont) Each package used a Façade pattern to provide a API to interact with the other packages The overall state of the whole game was kept in a single class Access to state was provided using the Command pattern Used the Singleton pattern to provide common state to all Objects.
Refactoring Comments Seemed a lot of time for minor releases Made the job of integration easier and also the final release Had to create some documentation to keep the algorithms we used upto date with each iteration.
Demo Initial Login
Network Screen Choose to host or join a game
Network time out management