Friday, December 19, 2014

A Hill of Beans

Team. An idea about placing a layer of beans which holds stencil replacement content on top of the beans which interface with the system entities struck yesterday. With limited experience with JAVA beans plus bean reflection, more reading must be done in the API reference before settling on this idea.

Also, there are many alternative ways to supply the stencil replacement content. Form beans generated with JSP and JSF pages also could have methods called by reflection to render content.

One our goals should be keeping any and all XML/XHTML elements out of the rendering methods source code. In other words it should not be hard-coded and compiled in the JAVA object.

Plus, we must reconsider stencil replacement tiles which supply content for an XHTML attribute or attribute lists. If we use an XML element called "tile" for these replacements, we will have malformed XML. Therefore, we could not use a DOM or SAX parser for the replacement tasks. Consider,

<td align="#ALIGNMENT#" #DYNAMIC_ATTRIBUTES#>Varied Alignment and Dynamic Attributes</td>

versus

<td align="<tile class='cab.TDHandler' method='renderAlignAttribute'/>" <tile class='cab.TDHandler' method='renderDynamicAttributes'/>>Varied Alignment and Dynamic Attributes</td>


This is malformed XHTML/XML, and a parser will not process it properly.
So, it will be likely that our directory.xml file will remain where it is. When working with JSP and JSF, we might achieve the same replacement effects with Expression Language (EL) and calling the rendering method. Consider,

<td align="#{cab.TDHandler.renderAlignAttribute()}"
 #{cab.TDHandler.renderDynamicAttributes()}>Varied Alignment and Dynamic Attributes</td>

Just a few thoughts before the weekend. The edited source code should be available on Monday. La-La.

No comments:

Post a Comment