DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://issues.apache.org/bugzilla/show_bug.cgi?id=31299>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=31299 Refactor RequestUtils to allow subclassing ------- Additional Comments From [EMAIL PROTECTED] 2004-10-12 12:36 ------- I personally have never had a need to do this, but I think making function points like this extensible is a good idea. I'd rather see the RequestUtil instance stored in the application scope (under a key unique to the module), than as a singleton. This can easily be abstracted behind the RequestUtil facade (since it can be assumed that it will always be used with a servletRequestContext object). This class can be configurable through a Controller Config attribute (or set-property). While on the topic of Request Util refactoring, it's time to break out the Object Facorty methods (applicationInstance and applicationClass). This has been moved to a ClassUtil in the Chain code. I'd like to take this a step further and make ObjectFactory as an interface with the implementation configured in the controller and put in the application scope. ObjectFactory public Class findClass(name); public Object getInstance(name); The default implementation would be basically "ClassloadObjectFactory" that behaves the exact same way as the RequestUtil (and duplicated in FormBeanConfig). I think this would be very useful to seperate because you could provide alternatives to Object generation, for example, GroovyObjectFactory, SpringObjectFactory, etc. Regardless if the interface/implementation pattern flies, the class utils should be moved from RequestUtil and FormBeanConfig. IMO these should be removed altogether (they can be deprecated first). However, if people feel strongly about accessing this from RequestUtil, delegate methods should be used. And... I do realize FormBeanConfig does things a little different with regards to DynaClasses etc., but taking a closer look, the class still findClass(name) the same way, and getInstance(name) the same way. It does a little before and after, but that can and should still be done in the FormBeanConfig. The findClass and getInstance should be handled through the ObjectFactory implementation though. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]