After beginning to use Snooze on a real project I realised it needed to be more extensible and more testable. So I re-wrote it!
The new code is now in the trunk: http://svn2.assembla.com/svn/snooze/trunk
A key extensibility point is the "ResourceContext" class. Before a resource is invoked, it's ResourceContext is initialised with relevant data such as HttpContext, invoke verb, GET view and file type. The base Resource class allows sub-classes to specify a particular ResourceContext sub-class, by the use of a generic type parameter. So when using Snooze in a web project it is easy to define extra context data that is always available to any resources. Instead of adding properties to a Resource class, the use of a context object allows data to be easily shared between a sub-resource and it's parent resource chain.
A Snooze resource also has a ResourceFactory object. The type of this is also generically typed so that a web project can provide a customized factory.
These changes make it easy to do things like test that a resource creates sub-resources (through the factory).
Remember Me
© Copyright 2008 Andrew Davey Theme Design by Bryan Bell newtelligence dasBlog 1.9.6264.0 | Page rendered at Monday, July 21, 2008 12:54:45 AM (GMT Standard Time, UTC+00:00) Pick a theme: BlogXP calmBlue Candid Blue dasBlog Discreet Blog Blue Elegante essence Just Html MadsSimple Mobile Mono Movable Radio Blue Movable Radio Heat nautica022 orangeCream