[ 
https://issues.apache.org/struts/browse/WW-1197?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_42476
 ] 

Tom Schneider commented on WW-1197:
-----------------------------------

I'm not sure I completely agree with this.  I wouldn't mind adding another 
level above UIBean, but I don't think I'd add all the interfaces that are being 
proposed.  I like the simplicity of the current hierarchy and I fear things 
would become too complicated if we add more than 1 more level of inheritance or 
start using interfaces for everything.  Besides, I'm not sure a lot of people 
have been creating custom UI components.  (Apart from myself)  My guess is that 
most people use the basic tags and never really dig into the UI tags themselves 
much at all.

> To have a few lighter weight parent objects for UI Components  to inherit 
> from when creating tags
> -------------------------------------------------------------------------------------------------
>
>                 Key: WW-1197
>                 URL: https://issues.apache.org/struts/browse/WW-1197
>             Project: Struts 2
>          Issue Type: Improvement
>    Affects Versions: WW 2.2
>            Reporter: Nathan Sarr
>            Priority: Minor
>             Fix For: 2.1.1
>
>
> This is a copy and paste from the initial post.  See full post at:
> http://forums.opensymphony.com/thread.jspa?threadID=18510&tstart=0
> For example webwork could have a TemplateBeanInterface with an
> interface for the Template* methods
> Then modify the TemplateContext and Template Engine to take a
> TemplateBeanInterface so that a Tag must only have the necessary
> TemplateBeanInterface to be used by the template engine and related
> classes.
> Following that a few other interfaces could be created:
> A BaseUiBeanInterface that has get and set methods for the following:
> class
> id
> style
> title
> see - http://www.w3schools.com/tags/ref_standardattributes.asp
> A FormEventBeanInterface that has get and set for the following:
> onchange,
> onsubmit,
> onreset,
> onselect,
> onblur,
> onfocus
> If we keep following the pattern we would have WindowEventUiBean,
> KeyboardEventUiBean ...
> see - http://www.w3schools.com/tags/ref_eventattributes.asp
> Finally webwork could create a few Base bean implementations like the
> following for tag developers:
> BaseTemplateUiBean implements TemplateBeanInterface{}
> BaseUiBean extends BaseTemplateUiBean implements BaseUiBeanInterface{}
> FormUiBean extends BaseUiBean implements FormEventBeanInterface{}
> That way tag developers can implement the interfaces themselves or grab
> one of the above implemented beans along the hierarchy that best meets
> their needs as well as create their own combinations of inherited
> classes and interfaces.
> *--------------------------------------------------------------------
> (NOTE: there was some concern about the performace of the following method
>   in the post.  Please see post for further details).
> I was also wondering about adding another method to one of the
> Base classes - something like
> public boolean addNonNullValue(String key, String value){
> boolean added = false;
> if( value != null ){
> added = true;
> addParameter(key, findString(value));
> }
> return added;
> }
> I noticed a lot of the following in the Component classes
> if (param != null) {
> addParameter("param", findString(param));
> }
> by adding the new method, I don't have to check for a null
> value every time I can just make the call
> addNonNullValue("param", param);

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to