Yeah. It's a bit nasty, but there's not really any other way to have both
the flexibility and the convenience, unless you have some brilliant other
idea?

It's like jk says, normally you would use the setter, unless you need
on-demand evaluation per page-view.

Regards,

Alastair

On Thu, Apr 3, 2008 at 4:49 PM, John Krasnay <[EMAIL PROTECTED]> wrote:

> On Thu, Apr 03, 2008 at 03:50:42PM +0100, Charlie Dobbie wrote:
> > Off Topic, but does anyone else apart from Scott and me get confused by
> this
> > duality?
> >
> > Should I setProperty, or override getProperty?  And the equally annoying
> > Does getComponentX give me a reference to an already-created ComponentX,
> or
> > do I override it to supply my own ComponentX?
> >
> > Charlie.
> >
>
> Overriding the getter has the advantage that it allows the property
> value to be lazily evaluated. This is good when the value of the
> property can change over the lifetime of the component, or when the
> value of the property is not known until the component is attached to
> its parent. Calling the setter is simpler, but you must know the value
> of the property ahead of time.
>
> jk
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to