From: James M. <jma...@gm...> - 2005-03-07 18:15:37
|
Hi all. Trying to keep up with all the issues here is hard, hopefully we can get it all sorted out in the IRC this afternoon. However, lets see what I can do to clear things up a little. There appeare to be two major discussions going on here.... 1) Should we use ServiceRegistary 2) How should we configure factory selection. These two issues do not, as far as I can tell, conflict. Yes ServiceRegistary has a setOrder method but that can be ignored. It also has a rather interesting Filter option -- getServiceProviders(Class category, ServiceRegistry.Filter filter, boolean useOrdering) -- but again we don't have to use that, we can write our own extention to ServiceRegistary and handle configuration in what ever way we like. I have no objection in principal to extending ServiceRegistary, the only reason it was avoided in the first place is that Sun stuck it in an imageio package making it look like it was a non-standard extention. (Actualy, Martin, can you just confirm that ServiceRegistary is a REQUIRED part of the platform - i.e. will non sun versions of Java (IBM?) have the javax packages by default if they are at least 1.4?) The major question with ServiceRegistary is how well it handles multiple classloaders, this will be crucial for uDIG as eclipse does some very odd things with classloaders. > > Either: > > 1) User create a CarFactoryFinder > > 2) User calls carFactoryFinder.setOrdering( "european", "japanese" ) > > 3) User creates a hints map I think we should try to remember that the goal of 'Hints' is different from a hard coded choice of implementation. Usualy if you set a system property for a specific factory implementation its because you NEED to recive an instance of that class for things to work properly. Hits, to me at least, are more along the lines of prefference (in the car example setOrdering("speed") or setOrdering("cost")) > > The only thing I'm aware of that FactoryFinder does and ServiceRegistry > don't, is to look at factories specified as a system property. This > functionality would be trivial to add on top of ServiceRegistry if we > actually use it. It might be worth noting that FactoryFinder was modeled on suns own code for determining which xml parser to use (I wonder what their reason for not using ServiceRegistary was). James |