oesmith/puffing-billy — pull request #41 by tmertens (2014-03-12 19:37:22+00:00)
Title: Refactor handlers

@oesmith

I wanted to post this PR for your early review. I tried to keep functional changes in this PR to a minimum - it is primarily a very large refactor of the existing code as an extensive clean-up effort which should hopefully facilitate easier feature enhancements and maintenance in the future. You will notice that the methods and classes added/changed in this PR are:
* Smaller and more light-weight than before.
* Adhere to the single responsibility principle as much as possible.
* Use duck typing rather than complicated logic to implement shared behavior among different classes (e.g. the 'Handlers') and rely on individual handlers themselves to implement their logic, rather than complicating the calling class.
* Makes the Cache a Singleton, making it easier to access and since there can only ever be one anyways.

This has already undergone a fair amount of review here if you want to review the discussion so far: https://github.com/centro/puffing-billy/pull/12 Functionally it is all working and should be both backwards compatible and ready to go, but I am still writing unit tests, so please wait to merge it in if it looks acceptable to you. The existing tests are all passing successfully.

I look forward to your comments and feedback!