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 Tue, 05 Feb 2008 14:51:11 GMT
> -----Original Message-----
> From: Antonio Petrelli [mailto:antonio.petrelli@gmail.com]
> Sent: Tuesday, February 05, 2008 4:14 PM
> To: dev@tiles.apache.org
> Subject: Re: Attribute-level extension point
> 
> 2008/2/5, Oleg Gorobets <oleg.goro@gmail.com>:
> >
> > Let's discuss providing an extension point for
> > BasicTilesContainer.render(Attribute,  Writer, Object... requestItems).
> > Much
> > like preparer acts for AttributeContext it will be useful to have such
> > ability for each concrete attribute.
> 
> 
> In fact you can use a definition as a value for an attribute, and put a
> preparer in this definition: does not it suffice for you?
> 


Sure, I can use a new definition/preparer for each attribute but that's a
little bit clumsy I guess. If I need to "prepare" every attribute there will
be a lot of unnecessary definitions.

I can suggest 2 solutions: the first is a simple one: define an
AttributePreparer much like ViewPreparer and call it whenever the rendering
phase starts, e.g. from BasicTilesContainer.render().

The second one is a higher abstraction which can be named "attribute
renderer" (as stated in TILES-190). This will allow fully customized
rendering.



Mime
View raw message