Well my goal with this idea was to make applications less dependent on the environment in which they run. The servlet environment can of course handle everything that this Registry can, but it is in the presentation tier. I think the Registry for the business tier should reside in the business tier. What if I want to offer a command-line interface to my application for, say, unit testing with JUnit (which I can currently do in my app for my DAOs but not for my business tier). If I use the servlet context as a registry then it is harder to write these tests.
Then the command-line program might want to use a Singleton. But that's up to the application. The key part is you can load the same Catalog into your command-line program or into a web application, without changing anything internal to the Chain and Command classes.
Right now, Chain is nicely scoped as a business layer framework that sits between the Controller and the Persistence Layer. This is a sweet spot, and I believe we shouldn't muddy it with trying to handle state.
Making "applications less dependent on the environment in which they run", would be the job of an application framework ("a semi-complete application"). All the presentation frameworks, including Struts, are working in this direction now, by moving towards a Context object that help to decouple components from the runtime environment. When they get there, Chain and its Context object, will be ready to hook up.
Hehe, I am often guilty of this in my own work. How do we get Chain out of the sandbox so we can start working on Agility? :) Should I move over to Struts and work on the decomposable request processor that Craig started out instead? I know one area Chain needs work is documentation, and I will be working on this in the coming weeks.
The two aren't codependent. But, again, frameworks are best created as abstractions of working applications. Without more working applications, it's too early to work on anything like a framework. I haven't even finished deploying it in one application yet. =:)
One thing that might be helpful is a ChainServlet, so people can plug Catalog into working web applications right away. I believe Craig, Greg, and I are all just using the Struts plugin right now, but that's only one place where it can be used.
Along the same lines, I suppose there could also be something like a generic ChainRegistry that was designed to load the Catalog and store it behind an interface as a Singleton. This might be something people would use in command-line or test programs, and so forth. But anything like this should also be strongly cast as optional or example component and not considered part of the core API. This is where we step over the line from "business layer framework" to "application framework", and I don't think that's a line we're ready to cross right now.
-Ted.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
