tiles-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oleg Gorobets" <oleg.g...@gmail.com>
Subject RE: Attribute-level extension point
Date Wed, 06 Feb 2008 11:48:06 GMT
> 
> +1 for the "unnecessary" definitions, but I think that the problem is only
> in the tiles-defs.xml file.
> What I mean is that we can still use the Definition class to describe an
> attribute with a preparer. The difference is that an "anonymous"
> definition
> is created whenever an attribute with a preparer is defined in the XML
> file.
> For example:
> 
> <definition name="mydef" template="/mytemplate.jsp">
>   <put-attribute name="attrib1" value="/firstTile.jsp"/ > <!-- Creates an
> Attribute of "template" value -->
>   <put-attribute name="attrib1" value="/secondTile.jsp" preparer="
> my.package.MyPreparer" /> <!--Creates an attribute of "definition" value,
> a
> new "anonymous" definition with the secondTile.jsp as a template and the
> defined preparer. -->
> </definition>


Hmm.. that's interesting, I'll try it, but this solution is not going to
solve the problem of defining preparer in each attribute. We need a way to
define preparer system-wide to make design more elegant. So I think we
definitely need to look inside TILES-190 and try to implement a "renderer"
concept.

 
> The second one is a higher abstraction which can be named "attribute
> > renderer" (as stated in TILES-190). This will allow fully customized
> > rendering.
> 
> 
> 
> In fact I was thinking of a "default renderer" dependent on the attribute
> type, and a custom renderer for the particular attribute.
> This solution needs a good design though. Anyone is willing to do a Class
> Diagram? :-)
> 

I guess we can start without "attribute type" and simply implement the
configurable renderer, which receive a String (defining the value of
attribute) and current attribute context. Later it can be extended with the
attribute  type. I'll try to help with this, but I'm not so familiar with
the existing design... I'll look into it if I find with the solution I'll
share it with you.



Mime
View raw message