[ https://issues.apache.org/struts/browse/WW
-1197?page=com.atlassian.jira.plugin.system.issuetabpanels:c
omment-tabpanel#action_42572 ]
Tom Schneider commented on WW-1197:
-----------------------------------
I don't really see a point to adding interfaces unless we
modify the template engine to only use the interfaces. Even
then, IMO I don't think there's a lot of benefit. The
question I would ask myself is: do we really expect more
than one implementation of the interfaces? My answer is no,
so I don't see the benefit of extracting them. This
especially becomes true when you talk about ditching the
current tags in favor of JSP 2 compliant tags.
> 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
> Components: Plugin - Tags
> 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.
|