Tuesday, February 15, 2005

Dining Philosophers and XP : Part 1

For my latest XP/Agile project I along with Partha chose the Dining Philosopher's (DP from now on) problem. After choosing it I saw the Dining Philosophers Challenge. We decided this is the perfect thing to do. Debunk the doubts against Test Driven development through a real life solving of a non-trivial problem. We also plan to use this opportunity to use the various design patterns we hear about. We will be doing pair programming together for the first time and I think we will get to spend only about an hour everyday on this project. So the Velocity is going to be pretty low.

In the first iteration we plan to do the following:
  • set up junit with eclipse
  • set up build structure and ant files
  • get basic functionality of DP with deadlock acceptable
  • a good commenting format
2nd iteration:
  • Factories of philosophers and getting the reference of philosopher by ID.
  • refactor code to remove all setters and getters
  • do setup and cleanup methods in junit classes and remove constructors for classes from all test classes
  • state pattern implementation for Chopstick and Philosopher
  • resolve deadlock
3rd iteration:
  • Implement Observer pattern for notification of lock capture and release
  • Implement fair-scheduler of threads
4th iteration:
  • minimising waiting time for chopsticks
  • maximing thinking time of philosophers
Any suggestions?


At 1:03 AM, Anonymous Anonymous said...

Not particular to your current project, but I understand your rationale for removing getters/setters. While the benefit is high, I don't understand how this would work in the context of web app frameworks which are largely dependent on them.

Do you define rendering strategies with concrete HTML representations? Or do you use adapters that are semantically geared for web presentation? Better way?

At 3:20 AM, Anonymous Dustin Aleksiuk said...

Rob Jeffries did this exact example here:


He was more interested in demonstrating a test-first approach so he didn't break out the tasks like you do.

It might be interesting to you anyway.

At 12:51 PM, Blogger sundar said...

hi anonymous: i am also not sure about how to handle web apps in this regard. thinking about it. at some point of time i want to be involved in a project which would render stuff differently (subsutantially) depending on the requirements(or platforms). maybe that should be my next project. but am keeping an open mind aboput it for now.

Yeah Dustin, it is pretty interesting. i will be putting up follow up posts on this topic detailing my experiences.


Post a Comment

<< Home