Heya all,
I got another possible maintenance task I would like to discuss about.
Currently, most constants are concentrated in 2 interfaces located in ui
package structure, namely
org.apache.myfaces.trinidadinternal.ui.laf.base.xhtml.XhtmlLafConstants
and org.apache.myfaces.trinidadinternal.ui.UIConstants.
Considering those package are doomed, I think it would be a nice and not
so complicated task to start moving all the constants those two classes
contain in a better one no longer located under those directories. Also, I
think it would be better to use non-instanciable classes rather than
interface so that it's impossible to implements/extends them for easy
access to the constants. This would increase the complexity of the
refactoring but in the end I believe it would make the code easier to
read.
Of course, this could be done in 2 different tasks, first moving the
constants to new interfaces and make
org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.XhtmlConstants
extends them to keep backward compatibility with the old structure, then
changing interfaces to classes one by one to reduce impact.
Anyway, the main question I see about it is what kind of structure should
be used. Personally I would like to see something like:
- SkinSelectors containing all and only skin selectors used by Trinidad
(cannot of course include selectors of user made components).
- XhtmlElements containing all valid xhtml tags.
- XhtmlAttributes containing all valid xhtml attributes.
- XhtmlAttributeValues containing all valid predefined attributes values
("middle", "left", "right", etc.)
- JsfAttributes containing most common jsf component attributes
("required", "value", "title", etc.)
- TrinidadAttributes containing most common Trinidad component attributes
("partialTriggers", "showRequired", "inlineStyle", etc.)
- TrinidadFacets containing most common Trinidad component facets ("help",
"nodeStamp", "branding", etc.)
Regards,
Simon Lessard
Fujitsu Consulting