[jira] Updated: (NANO-68) Factoring the action execution out of the servlet into a component
jira-yCVjj/[email protected] Wed, 14 Apr 2004 20:19:39 -0400 (EDT)
| Newsgroups | gmane.comp.java.nanocontainer.devel |
|---|---|
| Message-ID | <[email protected]> |
The following issue has been updated:
Updater: Gr?gory Joseph (mailto:[email protected])
Date: Wed, 14 Apr 2004 8:19 PM
Comment:
patch for nanoweb, new classes for nanoweb, patch for sample-nanoweb
Changes:
Attachment changed to nanoweb-modified.zip
---------------------------------------------------------------------
For a full history of the issue, see:
http://jira.codehaus.org/secure/ViewIssue.jspa?key=NANO-68&page=history
---------------------------------------------------------------------
View the issue:
http://jira.codehaus.org/secure/ViewIssue.jspa?key=NANO-68
Here is an overview of the issue:
---------------------------------------------------------------------
Key: NANO-68
Summary: Factoring the action execution out of the servlet into a component
Type: Improvement
Status: Unassigned
Priority: Major
Original Estimate: Unknown
Time Spent: Unknown
Remaining: Unknown
Project: NanoContainer
Components:
nanoweb
Versions:
1.0-beta-1
Assignee:
Reporter: Gr?gory Joseph
Created: Wed, 14 Apr 2004 8:15 PM
Updated: Wed, 14 Apr 2004 8:19 PM
Description:
The purpose of this improvement would be to extract the logic that
- knows how to get the action object from the ServletRequest
- knows how to execute this action
.. outside the NanoWebServlet, into a component, which can be registered in pico.
My current personal usecase for this is that I want to migrate jetspeed stuff (boo) to a nanoweb based framework (aah). But I'll need a transitional state, where I could for example keep my current jetspeed actions while only moving the rest of the webapp.
Other usecases include other migration scenarii, or simply giving users more freedom as how actions are retrieved and executed. (Current implementation ties the user to a strict url schema)
In the attached zip file, you'll find:
- a patch for nanoweb (including patch for the "nice" NanoWebServletTestCase, which I basically hacked until it worked, sorry..)
- new classes for nanoweb
- a patch for sample-nanoweb
- notice that ChainingDispatcher has been moved to the defaults subpackage.
You'll also notice that I introduced an antipattern in the CachingScriptClassLoader. Indeed, it depends on PicoContainer. I could not figure out another way to register scripts and get them back from the container, with satisfied dependencies.
Maybe this could be avoided if we didn't want the fallback behaviour of the default nanoweb implementation (if action class can't be found then look for a groovy script).
A solution might be to have two ActionExecutor: one for pojos, one for groovy scripts, register both in pico, and get an array of ActionExecutors in the servlet, use them until one returns an action. Since I do not know how arrays can be handled with pico, I left that for later, cause I wanted this through, and get some feedback about it.
I also do not like the Util object I made and its static method (ouch, don't hit me please). That was just a quick way around code replication, but please come up with better ideas around this. (Again, I first wanted something that worked)
I think the rest is pretty straightforward readable.
Some please rant, bile and comment ;)
I hope this (or something better) can make it to nanoweb, cause i *actually* need it, and i wouldn't want to fork ;)
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira