You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Don Brown <mr...@twdata.org> on 2006/07/12 07:28:56 UTC
[s2] Getting rid of statics
The ticket is WW-1369 [1] and its goal is to make it possible do deploy
two Struts 2 filter dispatchers with completely different configurations
side-by-side in the same web application. As I dig down into this, it
is becoming quite apparent this would be a huge change, and before I do
anything, I want to run it by everyone.
To make this work, most uses of the static keyword in both XWork and
Struts 2 would have to be removed. In their place, there would be an
Application object, which would have getters and setters to manage the
previously statically managed instances. Application would be able to
find itself via a threadlocal, initialized by either the filter or
portlet dispatcher in Struts. This "context object" is different than
ActionContext, because Application contains instances that are shared
among all requests for a given filter/portlet instance, where
ActionContext handles request-level instances.
The objects to be moved over include DispatcherUtils, (Struts)
Configuration, LocalizedTextUtils, various XWork factories for objects
like ActionProxy and ActionInvocation, and ObjectFactory.
Perhaps the end goal wouldn't be worth the effort, I don't know. I
think it would be a nice design feature, but I wanted to get more
feedback from others before I dive into this change that would
fundamentally alter both XWork and Struts 2.
Don
[1] http://issues.apache.org/struts/browse/WW-1369
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: [s2] Getting rid of statics
Posted by Jason Carreira <fo...@opensymphony.com>.
This was a long-time goal we had, but, as you noticed, it's not so easy and it breaks backward compatibility (which is ok now, but wasn't before)
Another thing to add to your list is the type converter, which is stored in a static instance.
If you see a good way to break this up into pieces, I'd be glad to help out with this effort. I've been meaning to get some coding done on Struts, and this one's near-and-dear to my heart.
> The ticket is WW-1369 [1] and its goal is to make it
> possible do deploy
> two Struts 2 filter dispatchers with completely
> different configurations
> side-by-side in the same web application. As I dig
> down into this, it
> is becoming quite apparent this would be a huge
> change, and before I do
> anything, I want to run it by everyone.
>
> To make this work, most uses of the static keyword in
> both XWork and
> Struts 2 would have to be removed. In their place,
> there would be an
> Application object, which would have getters and
> setters to manage the
> previously statically managed instances. Application
> would be able to
> find itself via a threadlocal, initialized by either
> the filter or
> portlet dispatcher in Struts. This "context object"
> is different than
> ActionContext, because Application contains instances
> that are shared
> among all requests for a given filter/portlet
> instance, where
> ActionContext handles request-level instances.
>
> The objects to be moved over include DispatcherUtils,
> (Struts)
> Configuration, LocalizedTextUtils, various XWork
> factories for objects
> like ActionProxy and ActionInvocation, and
> ObjectFactory.
>
> Perhaps the end goal wouldn't be worth the effort, I
> don't know. I
> think it would be a nice design feature, but I wanted
> to get more
> feedback from others before I dive into this change
> that would
> fundamentally alter both XWork and Struts 2.
>
> Don
>
> [1] http://issues.apache.org/struts/browse/WW-1369
>
> ------------------------------------------------------
> ---------------
> To unsubscribe, e-mail:
> dev-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> dev-help@struts.apache.org
>
>
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=37111&messageID=72922#72922
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org