You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Ron Piterman <rp...@gmx.net> on 2006/12/19 16:34:26 UTC

T5: Binding annotation, again

Continueing the @Bindings annotation discussion above,
it just accured to me: a real profit of a
@Binding annotation could be something like:

@Binding(name="name",number=5)

or

@Binding(name="name",bool=true)

or

@Binding(name="name",type=Object.class)

or

@Binding(name="name",string="some string")

or finally,

@Binding(name="name",expression="listener:somelistener")

where only expression is evaluated as bindings values are evaluate nowadays.

Cheers,
Ron


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


Re: T5: Binding annotation, again

Posted by D&J Gredler <dj...@gmail.com>.
Very interesting!!

On 12/20/06, Ron Piterman <rp...@gmx.net> wrote:
>
> Howard Lewis Ship wrote:
> > Interesting idea with the caveat that it can not be fully validated at
> > compile time (all of the extra attributes will need to have default
> values
> > ... oh and for primtives, its very hard to distinguish a default value
> > for a
> > provided value).
>
> there is a dirty trick: use int[] integer() instead of int integer();
> with a default value of {}. its dirty but it works, and can easily
> provide arrays as parameter bindings :)
> Cheers,
> Ron
>
>
> >
> > On 12/19/06, Ron Piterman <rp...@gmx.net> wrote:
> >>
> >> Continueing the @Bindings annotation discussion above,
> >> it just accured to me: a real profit of a
> >> @Binding annotation could be something like:
> >>
> >> @Binding(name="name",number=5)
> >>
> >> or
> >>
> >> @Binding(name="name",bool=true)
> >>
> >> or
> >>
> >> @Binding(name="name",type=Object.class)
> >>
> >> or
> >>
> >> @Binding(name="name",string="some string")
> >>
> >> or finally,
> >>
> >> @Binding(name="name",expression="listener:somelistener")
> >>
> >> where only expression is evaluated as bindings values are evaluate
> >> nowadays.
> >>
> >> Cheers,
> >> Ron
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> >> For additional commands, e-mail: dev-help@tapestry.apache.org
> >>
> >>
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>
>

Re: T5: Binding annotation, again

Posted by Ron Piterman <rp...@gmx.net>.
Howard Lewis Ship wrote:
> Interesting idea with the caveat that it can not be fully validated at
> compile time (all of the extra attributes will need to have default values
> ... oh and for primtives, its very hard to distinguish a default value
> for a
> provided value).

there is a dirty trick: use int[] integer() instead of int integer();
with a default value of {}. its dirty but it works, and can easily
provide arrays as parameter bindings :)
Cheers,
Ron


> 
> On 12/19/06, Ron Piterman <rp...@gmx.net> wrote:
>>
>> Continueing the @Bindings annotation discussion above,
>> it just accured to me: a real profit of a
>> @Binding annotation could be something like:
>>
>> @Binding(name="name",number=5)
>>
>> or
>>
>> @Binding(name="name",bool=true)
>>
>> or
>>
>> @Binding(name="name",type=Object.class)
>>
>> or
>>
>> @Binding(name="name",string="some string")
>>
>> or finally,
>>
>> @Binding(name="name",expression="listener:somelistener")
>>
>> where only expression is evaluated as bindings values are evaluate
>> nowadays.
>>
>> Cheers,
>> Ron
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: dev-help@tapestry.apache.org
>>
>>
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


Re: T5: Binding annotation, again

Posted by Ron Piterman <rp...@gmx.net>.
In one project we use many generic components and use the parameters of
type class alot - currenty I find there is no "good way" of passing a
class as parameter. The best I know is delegate to a method on the
component which look like:

<binding name="name" value="fooClass"/>

getFooClass() { return Foo.class };

because this is "refactoring-safe"...

but the application is full of such bindings, and its really
intimidating...
Cheers,
Ron


Howard Lewis Ship wrote:
> Interesting idea with the caveat that it can not be fully validated at
> compile time (all of the extra attributes will need to have default values
> ... oh and for primtives, its very hard to distinguish a default value
> for a
> provided value).
> 
> On 12/19/06, Ron Piterman <rp...@gmx.net> wrote:
>>
>> Continueing the @Bindings annotation discussion above,
>> it just accured to me: a real profit of a
>> @Binding annotation could be something like:
>>
>> @Binding(name="name",number=5)
>>
>> or
>>
>> @Binding(name="name",bool=true)
>>
>> or
>>
>> @Binding(name="name",type=Object.class)
>>
>> or
>>
>> @Binding(name="name",string="some string")
>>
>> or finally,
>>
>> @Binding(name="name",expression="listener:somelistener")
>>
>> where only expression is evaluated as bindings values are evaluate
>> nowadays.
>>
>> Cheers,
>> Ron
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: dev-help@tapestry.apache.org
>>
>>
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


Re: T5: Binding annotation, again

Posted by Howard Lewis Ship <hl...@gmail.com>.
Interesting idea with the caveat that it can not be fully validated at
compile time (all of the extra attributes will need to have default values
... oh and for primtives, its very hard to distinguish a default value for a
provided value).

On 12/19/06, Ron Piterman <rp...@gmx.net> wrote:
>
> Continueing the @Bindings annotation discussion above,
> it just accured to me: a real profit of a
> @Binding annotation could be something like:
>
> @Binding(name="name",number=5)
>
> or
>
> @Binding(name="name",bool=true)
>
> or
>
> @Binding(name="name",type=Object.class)
>
> or
>
> @Binding(name="name",string="some string")
>
> or finally,
>
> @Binding(name="name",expression="listener:somelistener")
>
> where only expression is evaluated as bindings values are evaluate
> nowadays.
>
> Cheers,
> Ron
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>
>


-- 
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com