What happened to property accessor methods generation in T5 ?

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

What happened to property accessor methods generation in T5 ?

Hugo Palma-4
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Howard Lewis Ship
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 <[hidden email]> 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: [hidden email]
>  For additional commands, e-mail: [hidden email]
>
>



--
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Howard Lewis Ship
In reply to this post by Hugo Palma-4
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 <[hidden email]> 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: [hidden email]
>  For additional commands, e-mail: [hidden email]
>
>



--
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Cesar Lesc
May be is a sign that you need to refactor your class because is
getting too many responsibilities. :)

César.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Filip S. Adamsen-2
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: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Davor Hrg
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 <[hidden email]> 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: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Hugo Palma-4
In reply to this post by Howard Lewis Ship
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 <[hidden email]> 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: [hidden email]
>>  For additional commands, e-mail: [hidden email]
>>
>>
>>    
>
>
>
>  
Reply | Threaded
Open this post in threaded view
|

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

Hugo Palma-4
In reply to this post by Davor Hrg
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 <[hidden email]> 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: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>>
>>>
>>>      
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>>    
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
>  
Reply | Threaded
Open this post in threaded view
|

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

Martin Kersten-2
In reply to this post by Hugo Palma-4
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:[hidden email]]
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 <[hidden email]> 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: [hidden email]
>>  For additional commands, e-mail: [hidden email]
>>
>>
>>    
>
>
>
>  

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Davor Hrg
@GenerateAccessors
has been aded yesterday to current dev version : T5.0.11

Davor Hrg


On 3/3/08, Martin Kersten <[hidden email]> 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:[hidden email]]
> 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 <[hidden email]> 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: [hidden email]
> >>  For additional commands, e-mail: [hidden email]
> >>
> >>
> >>
> >
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Peter Stavrinides
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 <[hidden email]> 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:[hidden email]]
>> 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 <[hidden email]> 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: [hidden email]
>>>>  For additional commands, e-mail: [hidden email]
>>>>
>>>>
>>>>
>>>>        
>>>
>>>
>>>      
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>>    
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>  

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Adriaan Joubert-3
In reply to this post by Davor Hrg
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Howard Lewis Ship
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 <[hidden email]> 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: [hidden email]
>  For additional commands, e-mail: [hidden email]
>
>



--
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Adriaan Joubert-3
Excellent! Thanks a lot Howard!

Adriaan

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]