Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Struts Wiki" for change 
notification.

The following page has been changed by MichaelJouravlev:
http://wiki.apache.org/struts/RoughSpots

------------------------------------------------------------------------------
  Some things that could be addresssed before Action 2.0.0. (If we don't 
address them, we'll be stuck supporting them throughout all eternity or until 
Struts 3.0.0, whichever comes first. ;))
  
- We have a small number of existing WebWork users compared to the number of 
Struts users we'll (hopefully) eventually have. This is a new framework (if 
only in name) and a major release. This is our one chance to break 
compatibility. We must get it right now, because we will *not* be able to fix 
most of these problems later (the cost of breaking existing Struts users will 
almost always outweigh the value of the fix).
+ We have a small number of existing !WebWork users compared to the number of 
Struts users we'll (hopefully) eventually have. This is a new framework (if 
only in name) and a major release. This is our one chance to break 
compatibility. We must get it right now, because we will *not* be able to fix 
most of these problems later (the cost of breaking existing Struts users will 
almost always outweigh the value of the fix).
  
  We do not need to expose Struts users to XWork; they do not care. At the very 
least we should build a thin abstraction layer to isolate users from XWork. 
XWork should be an implementation detail not part of the SAF API. We can make 
most of the following changes in SAF's abstraction layer and avoid breaking 
existing XWork users. 
  
@@ -220, +220 @@

    1. How does WW help the user with state management?  As far as I can tell, 
if I want to keep a 'user' object around I have to interact with the map 
returned by ActionContext.getSession().  Actions should in general have a 
type-safe and transparent way to do this, e.g. by subclassing ActionContext and 
providing getUser()/setUser() which store the user in session.  This allows for 
re-working of the storage strategy (e.g. write a cookie and lookup the user 
each time) without affecting actions.
    1. In tandem with the previous point, since Actions are already stateful, 
it'd be nice to have the ActionContext injected into the Action.  One benefit 
is when a newbie developer needs it, the linkage is obvious (they don't have to 
a priori know about the ActionContext, they're being handed in it on a 
platter). If the developer can subclass ActionContext, it would also encourage 
them to implement a base action which accepts the context inject and leveraging 
the fact that JDK 1.5 allows co-variant returns, also write a getContext() 
method that returns the down-casted type; they wouldn't have to do 
((MyActionContext) ActionContext.getContext()).getUser() for example, just 
getContext().getUser().
    1. HTML analog tags should stick to HTML attributes. I dont' mean they 
shouldn't have more functionality, but the attributes should be identical where 
possible, and they shouldn't do things like render a label and an input.  
Keeping them more like regular HTML tags makes them easier to ramp up on, and 
more non-developer friendly
+     * [MJ] I see the following options when it comes to tags. (1) Use plain 
HTML + implicit scoped variables like "actionName", "actionAddress", etc. to 
create dynamic values; this looks pretty compact with JSP 2.0. (2) Use 1:1 
relation between WW tags and HTML tags. (3) Use 1:M relation between WW tags 
and HTML tags, like to create data entry form or a table. (4) Use 
non-HTML-looking tags + more abstract attributes + "media" attribute, thus 
creating something like JSF renderer for different media. Choosing between (1) 
and (2) I prefer the first one.
    1. Actions should return concrete objects, not symbolic results.  Symbolic 
results might have been optimal when you had one event/method per action and 
the outcomes were always whole-page views, but they get in the way now.  When 
you want to return anything that requires more than the symbol, you have to do 
some less than intuitive things to make the Action and the Result cooperate.  
I'd prefer to see a concrete Result get returned from Action methods, which 
would allows developers to do more powerful things more easily.  There are a 
bunch of ways to make it backward compatible too.  You could return 'new 
SymbolicResult("success")' and have the SymbolicResult do the lookup stuff (You 
could even redefine the String constants to be SymbolicResults).  You could 
alternatively use a static class to do Results.find(SUCCESS).  Or you could 
even allow method to continue to return String or Result, and if String wrap it 
in a SymbolicResult.
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to