Hi Jerome,

Jerome Louvel <contact <at> noelios.com> writes:
> Hi again,
> To facilitate the creation of Finder subclasses, I've exposed the
> "resourceClass" property with a getter. I've also extracted the Resource
> creation logic from Finder.findTarget() into a Finder.createResource()
> method. By default, findTarget() invokes createResource(), but this should
> facilitate the implementation of pooling mechanisms if required. Finally,
> I've added a "finderClass" property on Router that will automatically create
> the right Finder instance for you when calling attach("/uri/...",
> myResource.class). Changes are already in SVN. 

Thanks for this, it should meet all the requirements I suggested. This 
approach may more tightly couple Resource with Router and Finder than
would the factory approach...I  don't know if that's a problem. 
It also requires one to subclass finder rather
than provide a factory reference. I personally prefer extension through
delegation over subclassing. (See Effective Java, Item 14: Favor composition
over inheritance).

Regardless of philosophy, this is a powerful addition. Thanks again!

Sean

Reply via email to