Hi Sean,
[...] > The original problem was that I couldn't > parameterize Resources with my state because construction of resources > was controlled by the Finder which only understood two constructor > signatures. > > With the above changes, I now have control over construction > of resources > by extending Finder and overriding createResource(). The > problem is that > I can't parameterize the Finder because, just like with Resource > before, Finder construction is not under my control. I cannot say: > > new Finder(context, myState); > > The Router insists on it's known constructor forms so I can't > set state. You can get your state in two ways: 1) Get your Application instance via the Context As explained in the other email, you can do get you state inside your custom Finder then use it in the createResource() method to populate your resources. 2) Attach a custom Finder directly to the Router: Do: myRouter.attach(uriPattern, new MyFinder(context, myState)); You are not obliged to use the attach() methods taking a Resource class as parameter. > I still think the right answer is to allow use of a resource factory. > > So a way to do this is to add a constructor, > Finder(Context context, ResourceFactory factory) > > The code in createResource checks for and uses the factory, > else it does what it does now. > > In Router, add: > attach(String uriPattern, ResourceFactory factory) > attachDefault(ResourceFactory factory); IMHO, the current solution is very close to what you propose, just consider that the Finder class is similar to your proposed ResourceFactory. Best regards, Jerome

