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