You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Denis Stepanov <de...@gmail.com> on 2011/10/18 12:35:07 UTC

@Property and existing getter or setter

Hi everyone,

when using @Property anotation on a page with existing getter or setter Tapestry will throw an exception, would it be better to just ignore adding a new method rather than throwing an exception? I don't think it could lead to unexpected behavior, there is not so many cases when there is a getter/setter in super class, it will save time checking if read/write is consistent with getters/setters and fixing unexpected exceptions.

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


Re: @Property and existing getter or setter

Posted by Muhammad Gelbana <m....@gmail.com>.
I agree with Steve. Sometimes you need to see some exceptions thrown to stay
on the right path.

On Tue, Oct 18, 2011 at 2:47 PM, Denis Stepanov <de...@gmail.com>wrote:

>
> > ...by adding @Property you're asking for a getter / setter pair that
> > are benign in operation and have no side effects whereas your own
> > getters and setters could do anything.
> >
> > If you have a nefarious setter but don't notice it because you were
> > blinded by the @Property annotation I can foresee bugs creeping into
> > code which would be hard to track down.
>
>
> sure, only when you expect that @Property will fail if you already have
> getter/setter, 5.2 used to overload methods from superclass…
>
> anyway you can also mistype onevent method and wondering what went wrong
>
> > With live page reloading, surely the time taken to add (write=false)
> > and click refresh is negligible, no?
>
> our app reloads between 10-20seconds so it does matter right now, 5.3
> should improve it
>
> Denis
>
> Oct 18, 2011 v 1:26 PM, Steve Eynon:
> >
> > Steve.
> >
> > On 18 October 2011 18:35, Denis Stepanov <de...@gmail.com>
> wrote:
> >> Hi everyone,
> >>
> >> when using @Property anotation on a page with existing getter or setter
> Tapestry will throw an exception, would it be better to just ignore adding a
> new method rather than throwing an exception? I don't think it could lead to
> unexpected behavior, there is not so many cases when there is a
> getter/setter in super class, it will save time checking if read/write is
> consistent with getters/setters and fixing unexpected exceptions.
> >>
> >> Denis
> >> ---------------------------------------------------------------------
> >> 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
> >
>
>


-- 
*Regards,*
*Muhammad Gelbana
Java Developer*

Re: @Property and existing getter or setter

Posted by Denis Stepanov <de...@gmail.com>.
> ...by adding @Property you're asking for a getter / setter pair that
> are benign in operation and have no side effects whereas your own
> getters and setters could do anything.
> 
> If you have a nefarious setter but don't notice it because you were
> blinded by the @Property annotation I can foresee bugs creeping into
> code which would be hard to track down.


sure, only when you expect that @Property will fail if you already have getter/setter, 5.2 used to overload methods from superclass…

anyway you can also mistype onevent method and wondering what went wrong

> With live page reloading, surely the time taken to add (write=false)
> and click refresh is negligible, no?

our app reloads between 10-20seconds so it does matter right now, 5.3 should improve it

Denis

Oct 18, 2011 v 1:26 PM, Steve Eynon:
> 
> Steve.
> 
> On 18 October 2011 18:35, Denis Stepanov <de...@gmail.com> wrote:
>> Hi everyone,
>> 
>> when using @Property anotation on a page with existing getter or setter Tapestry will throw an exception, would it be better to just ignore adding a new method rather than throwing an exception? I don't think it could lead to unexpected behavior, there is not so many cases when there is a getter/setter in super class, it will save time checking if read/write is consistent with getters/setters and fixing unexpected exceptions.
>> 
>> Denis
>> ---------------------------------------------------------------------
>> 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: @Property and existing getter or setter

Posted by Steve Eynon <st...@alienfactory.co.uk>.
I'm not so convinced...

...by adding @Property you're asking for a getter / setter pair that
are benign in operation and have no side effects whereas your own
getters and setters could do anything.

If you have a nefarious setter but don't notice it because you were
blinded by the @Property annotation I can foresee bugs creeping into
code which would be hard to track down.

> it will save time checking

With live page reloading, surely the time taken to add (write=false)
and click refresh is negligible, no?

Steve.

On 18 October 2011 18:35, Denis Stepanov <de...@gmail.com> wrote:
> Hi everyone,
>
> when using @Property anotation on a page with existing getter or setter Tapestry will throw an exception, would it be better to just ignore adding a new method rather than throwing an exception? I don't think it could lead to unexpected behavior, there is not so many cases when there is a getter/setter in super class, it will save time checking if read/write is consistent with getters/setters and fixing unexpected exceptions.
>
> Denis
> ---------------------------------------------------------------------
> 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