You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Hugo Palma <hu...@gmail.com> on 2008/03/01 01:34:02 UTC

What happened to property accessor methods generation in T5 ?

This is a really cool feature in T4, but it's not present in T5. I'm
finding that my classes are getting filled with getters and setters when
they could easily (i think) be generated at runtime just like in T4.

Is this by design or is it just a missing feature that will be
implemented in the future ?

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


Re: What happened to property accessor methods generation in T5 ?

Posted by Hugo Palma <hu...@gmail.com>.
Thanks for the pointer.
I didn't find that issue when looking for something similar.


Davor Hrg wrote:
> I've created a minimaly invasive patch for this some time ago,
> https://issues.apache.org/jira/browse/TAPESTRY-2116
>
> it only requires notion of transformable methods for ClassTransformation
> so any field access inside them gets transformed....
>
> I've been patching tapestry with it since, because I use it in my apps
> all the time,
>
> no one is forced to use this, and of course it is useless for properties
> used in unit tests... but I really do not want to test my local variable
> used in loop....
>
> It's not like I couldn't live without it ....
> why is it so wrong to use this ?
>
> Davor Hrg
>
> On 3/1/08, Filip S. Adamsen <fs...@fsadev.com> wrote:
>   
>> Yeah, I tend to break up big pages into smaller components, especially
>> if I can get any re-use out of it, which - it turns out - I often can.
>>
>> -Filip
>>
>> César Lesc skrev:
>>     
>>> May be is a sign that you need to refactor your class because is
>>> getting too many responsibilities. :)
>>>
>>> César.
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>>       
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>     
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>   

Re: What happened to property accessor methods generation in T5 ?

Posted by Davor Hrg <hr...@gmail.com>.
I've created a minimaly invasive patch for this some time ago,
https://issues.apache.org/jira/browse/TAPESTRY-2116

it only requires notion of transformable methods for ClassTransformation
so any field access inside them gets transformed....

I've been patching tapestry with it since, because I use it in my apps
all the time,

no one is forced to use this, and of course it is useless for properties
used in unit tests... but I really do not want to test my local variable
used in loop....

It's not like I couldn't live without it ....
why is it so wrong to use this ?

Davor Hrg

On 3/1/08, Filip S. Adamsen <fs...@fsadev.com> wrote:
> Yeah, I tend to break up big pages into smaller components, especially
> if I can get any re-use out of it, which - it turns out - I often can.
>
> -Filip
>
> César Lesc skrev:
> > May be is a sign that you need to refactor your class because is
> > getting too many responsibilities. :)
> >
> > César.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

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


Re: What happened to property accessor methods generation in T5 ?

Posted by "Filip S. Adamsen" <fs...@fsadev.com>.
Yeah, I tend to break up big pages into smaller components, especially 
if I can get any re-use out of it, which - it turns out - I often can.

-Filip

César Lesc skrev:
> May be is a sign that you need to refactor your class because is
> getting too many responsibilities. :)
> 
> César.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 

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


Re: What happened to property accessor methods generation in T5 ?

Posted by César Lesc <ce...@gmail.com>.
May be is a sign that you need to refactor your class because is
getting too many responsibilities. :)

César.

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


Re: What happened to property accessor methods generation in T5 ?

Posted by Howard Lewis Ship <hl...@gmail.com>.
Also, there's the var: binding prefix, which allows for the storage of
temporary values.  However, its limitation is that the value is not
typed, so you can't build property expressions off of it.

On Fri, Feb 29, 2008 at 4:34 PM, Hugo Palma <hu...@gmail.com> wrote:
> This is a really cool feature in T4, but it's not present in T5. I'm
>  finding that my classes are getting filled with getters and setters when
>  they could easily (i think) be generated at runtime just like in T4.
>
>  Is this by design or is it just a missing feature that will be
>  implemented in the future ?
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>  For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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


Re: What happened to property accessor methods generation in T5 ?

Posted by Adriaan Joubert <ad...@gmail.com>.
Excellent! Thanks a lot Howard!

Adriaan

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


Re: What happened to property accessor methods generation in T5 ?

Posted by Howard Lewis Ship <hl...@gmail.com>.
I agree it should go in 5.0.12; I may find time over the weekend.

On Wed, Mar 12, 2008 at 2:13 AM, Adriaan Joubert <ad...@gmail.com> wrote:
> Hi,
>
>
>  echoing Peter, it would be great to see support for a trailing suffix.
>  I put in a JIRA
>
>  https://issues.apache.org/jira/browse/TAPESTRY-2236
>
>  for this, with the few lines of code that should fix this issue. Any
>  chance of putting these into the 5.0.12 snapshot?
>
>  Cheers,
>
>  Adriaan
>
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>  For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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


Re: What happened to property accessor methods generation in T5 ?

Posted by Adriaan Joubert <ad...@gmail.com>.
Hi,


echoing Peter, it would be great to see support for a trailing suffix.
I put in a JIRA

https://issues.apache.org/jira/browse/TAPESTRY-2236

for this, with the few lines of code that should fix this issue. Any
chance of putting these into the 5.0.12 snapshot?

Cheers,

Adriaan

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


Re: What happened to property accessor methods generation in T5 ?

Posted by Peter Stavrinides <p....@albourne.com>.
Brilliant, thanks for this!!! .... one suggestion:

@GenerateAccessors
private Field _myField;

works fine, but:

@GenerateAccessors
private Field myField_;

breaks... both ways should work as they are both recognized as a Java 
best practice for naming of fields.

Many thanks,
Peter


Davor Hrg wrote:
> @GenerateAccessors
> has been aded yesterday to current dev version : T5.0.11
>
> Davor Hrg
>
>
> On 3/3/08, Martin Kersten <Ma...@mercateo.com> wrote:
>   
>> One thing I can wish for is accessing properties by field when
>> using the expression language within a template.
>>
>> For testing Howard is right but knowing myself I mearly test
>> few event methods separatly.
>>
>> So for replacing getters when I only want to access template
>> related properties I would like to vow a strict Yes.
>>
>>
>> Cheers,
>>
>> Martin (Kersten)
>>
>> PS: Since I just upgraded to 5.0.10 I am unsure if this has
>> already been added.
>>
>> -----Ursprüngliche Nachricht-----
>> Von: Hugo Palma [mailto:hugo.m.palma@gmail.com]
>> Gesendet: Montag, 3. März 2008 11:45
>> An: Tapestry users
>> Betreff: Re: What happened to property accessor methods generation in T5 ?
>>
>> True, but even if one was only able to remove 10% of the getters and setters, wouldn't it be worth it ?
>>
>> I think the Tapestry 5 way of doing thing is great, practically everything is JAVA code. But, this also obviously means, more JAVA code.
>> So, Tapestry should also help the developer keep that code as clean as possible. I think a @GenerateAccessors or whatever name it would have would be a great addition to the framework.
>>
>>
>> Howard Lewis Ship wrote:
>>     
>>> I've thought about adding an @Accessible or @GenerateAccessors
>>> annotation that would create the getter and setter automatically.
>>> However, that gets in the way of testablility ... for testing
>>> purposes, you are likely to have those getter and setter methods
>>> anyway.
>>>
>>>
>>> On Fri, Feb 29, 2008 at 4:34 PM, Hugo Palma <hu...@gmail.com> wrote:
>>>
>>>       
>>>> This is a really cool feature in T4, but it's not present in T5. I'm
>>>> finding that my classes are getting filled with getters and setters
>>>> when  they could easily (i think) be generated at runtime just like in T4.
>>>>
>>>>  Is this by design or is it just a missing feature that will be
>>>> implemented in the future ?
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>>  To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>  For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>>
>>>>
>>>>         
>>>
>>>
>>>       
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>     
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>   

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


Re: What happened to property accessor methods generation in T5 ?

Posted by Davor Hrg <hr...@gmail.com>.
@GenerateAccessors
has been aded yesterday to current dev version : T5.0.11

Davor Hrg


On 3/3/08, Martin Kersten <Ma...@mercateo.com> wrote:
> One thing I can wish for is accessing properties by field when
> using the expression language within a template.
>
> For testing Howard is right but knowing myself I mearly test
> few event methods separatly.
>
> So for replacing getters when I only want to access template
> related properties I would like to vow a strict Yes.
>
>
> Cheers,
>
> Martin (Kersten)
>
> PS: Since I just upgraded to 5.0.10 I am unsure if this has
> already been added.
>
> -----Ursprüngliche Nachricht-----
> Von: Hugo Palma [mailto:hugo.m.palma@gmail.com]
> Gesendet: Montag, 3. März 2008 11:45
> An: Tapestry users
> Betreff: Re: What happened to property accessor methods generation in T5 ?
>
> True, but even if one was only able to remove 10% of the getters and setters, wouldn't it be worth it ?
>
> I think the Tapestry 5 way of doing thing is great, practically everything is JAVA code. But, this also obviously means, more JAVA code.
> So, Tapestry should also help the developer keep that code as clean as possible. I think a @GenerateAccessors or whatever name it would have would be a great addition to the framework.
>
>
> Howard Lewis Ship wrote:
> > I've thought about adding an @Accessible or @GenerateAccessors
> > annotation that would create the getter and setter automatically.
> > However, that gets in the way of testablility ... for testing
> > purposes, you are likely to have those getter and setter methods
> > anyway.
> >
> >
> > On Fri, Feb 29, 2008 at 4:34 PM, Hugo Palma <hu...@gmail.com> wrote:
> >
> >> This is a really cool feature in T4, but it's not present in T5. I'm
> >> finding that my classes are getting filled with getters and setters
> >> when  they could easily (i think) be generated at runtime just like in T4.
> >>
> >>  Is this by design or is it just a missing feature that will be
> >> implemented in the future ?
> >>
> >>
> >> ---------------------------------------------------------------------
> >>  To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >>  For additional commands, e-mail: users-help@tapestry.apache.org
> >>
> >>
> >>
> >
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

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


AW: What happened to property accessor methods generation in T5 ?

Posted by Martin Kersten <Ma...@mercateo.com>.
One thing I can wish for is accessing properties by field when
using the expression language within a template. 

For testing Howard is right but knowing myself I mearly test 
few event methods separatly. 

So for replacing getters when I only want to access template
related properties I would like to vow a strict Yes.


Cheers,

Martin (Kersten)

PS: Since I just upgraded to 5.0.10 I am unsure if this has
already been added.

-----Ursprüngliche Nachricht-----
Von: Hugo Palma [mailto:hugo.m.palma@gmail.com] 
Gesendet: Montag, 3. März 2008 11:45
An: Tapestry users
Betreff: Re: What happened to property accessor methods generation in T5 ?

True, but even if one was only able to remove 10% of the getters and setters, wouldn't it be worth it ?

I think the Tapestry 5 way of doing thing is great, practically everything is JAVA code. But, this also obviously means, more JAVA code.
So, Tapestry should also help the developer keep that code as clean as possible. I think a @GenerateAccessors or whatever name it would have would be a great addition to the framework.


Howard Lewis Ship wrote:
> I've thought about adding an @Accessible or @GenerateAccessors 
> annotation that would create the getter and setter automatically.
> However, that gets in the way of testablility ... for testing 
> purposes, you are likely to have those getter and setter methods 
> anyway.
>
>
> On Fri, Feb 29, 2008 at 4:34 PM, Hugo Palma <hu...@gmail.com> wrote:
>   
>> This is a really cool feature in T4, but it's not present in T5. I'm  
>> finding that my classes are getting filled with getters and setters 
>> when  they could easily (i think) be generated at runtime just like in T4.
>>
>>  Is this by design or is it just a missing feature that will be  
>> implemented in the future ?
>>
>>  
>> ---------------------------------------------------------------------
>>  To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>  For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>     
>
>
>
>   

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


Re: What happened to property accessor methods generation in T5 ?

Posted by Hugo Palma <hu...@gmail.com>.
True, but even if one was only able to remove 10% of the getters and
setters, wouldn't it be worth it ?

I think the Tapestry 5 way of doing thing is great, practically
everything is JAVA code. But, this also obviously means, more JAVA code.
So, Tapestry should also help the developer keep that code as clean as
possible. I think a @GenerateAccessors or whatever name it would have
would be a great addition to the framework.


Howard Lewis Ship wrote:
> I've thought about adding an @Accessible or @GenerateAccessors
> annotation that would create the getter and setter automatically.
> However, that gets in the way of testablility ... for testing
> purposes, you are likely to have those getter and setter methods
> anyway.
>
>
> On Fri, Feb 29, 2008 at 4:34 PM, Hugo Palma <hu...@gmail.com> wrote:
>   
>> This is a really cool feature in T4, but it's not present in T5. I'm
>>  finding that my classes are getting filled with getters and setters when
>>  they could easily (i think) be generated at runtime just like in T4.
>>
>>  Is this by design or is it just a missing feature that will be
>>  implemented in the future ?
>>
>>  ---------------------------------------------------------------------
>>  To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>  For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>     
>
>
>
>   

Re: What happened to property accessor methods generation in T5 ?

Posted by Howard Lewis Ship <hl...@gmail.com>.
I've thought about adding an @Accessible or @GenerateAccessors
annotation that would create the getter and setter automatically.
However, that gets in the way of testablility ... for testing
purposes, you are likely to have those getter and setter methods
anyway.


On Fri, Feb 29, 2008 at 4:34 PM, Hugo Palma <hu...@gmail.com> wrote:
> This is a really cool feature in T4, but it's not present in T5. I'm
>  finding that my classes are getting filled with getters and setters when
>  they could easily (i think) be generated at runtime just like in T4.
>
>  Is this by design or is it just a missing feature that will be
>  implemented in the future ?
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>  For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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