From: Brian G. <br...@qu...> - 2003-03-26 20:44:17
|
> I think it would be great to add this Constructor, but it's a bit more > complicated. The args to the WM constructor are used to determine the > Broker instance. Currently the key used to retreive the Broker for a > Servlet is just the ServletContext. Since the broker manages the settings, > you would want a separate broker instance for each ServletContext/Settings > combination AFAICT. > > The best approach may be to implement a new Broker class that the new WM > constructor would use. Then the new Broker could handle the various kinds > of settings that you want to throw at it transparently. > > btw, this seems like a lot of extra complexity in order to accommodate this > particular functionality. I'm guessing that the idea here is that this > would require less system resources than lots of separate Web apps. Perhaps > this should be a post 1.0 enhancement? Just a thought. (I like to follow > the XP model of building the simplest solution first and then refactoring.) It makes sense, but could be messy. Eric and I (motivated by suggestions from Marc) have discussed what we think is the sensible refactoring here -- create an entity called WMInstance. This is the missing concept, and what complicates the various construction woes. A big part of the problem is that the WM object is a thin facade onto the broker. Better would be to have factory methods for locating WM instances -- getWM(config-file), getWM(Servlet), etc. They would either find the right instance or create a new one. Then, if you wanted to manage instances yourself, you could do so. An instance would "own" a broker, its settings, etc. The other part of the problem is just that the names for the major classes, like Broker, are inappropriately chosen, which is confusing. |