+1 for keeping calls to add() in the Component constructor.  This
makes upgrading as painless as possible.

+1 also for having onInitialize() mimic:

private boolean initialized = false;
/// etc
protected void onBeforeRender() {
  if (!initialized) {
    onInitialize();
    initialized = true;
  }
  // other onBeforeRender stuff
}

Thank you all,
Scott

On Thu, Mar 10, 2011 at 2:54 PM, Coleman, Chris
<[email protected]> wrote:
> +1 for the approach you mention where onInitialize is called from the 
> framework and not as a surprise side effect of calling page#add().
>
> From: Maarten Billemont [mailto:[email protected]]
>
> On 10 Mar 2011, at 00:42, Igor Vaynberg wrote:
>>> i am +0 for refactoring the code so that oninitialize() cascade is not
>>> started from page#add() but from somewhere before page#onconfigure().
>>> this way oninitialize() is safe to override in pages because it will
>>> not be invoked from page's constructor but from some framework code at
>>> a later time.
>
>>Then I think that's the only actual solution that has positive votes.  
>>Without any further feedback, can we agree to leave constructors as they are, 
>>make onInitialize >overridable and do it this way?
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
>
>
> DISCLAIMER:---------------------------------------------------------------------------
> This e-mail transmission and any documents, files and previous e-mail messages
> attached to it are private and confidential. They may contain proprietary or 
> copyright
> material or information that is subject to legal professional privilege. They 
> are for
> the use of the intended recipient only.  Any unauthorised viewing, use, 
> disclosure,
> copying, alteration, storage or distribution of, or reliance on, this message 
> is
> strictly prohibited. No part may be reproduced, adapted or transmitted 
> without the
> written permission of the owner. If you have received this transmission in 
> error, or
> are not an authorised recipient, please immediately notify the sender by 
> return email,
> delete this message and all copies from your e-mail system, and destroy any 
> printed
> copies. Receipt by anyone other than the intended recipient should not be 
> deemed a
> waiver of any privilege or protection. Thales Australia does not warrant or 
> represent
> that this e-mail or any documents, files and previous e-mail messages 
> attached are
> error or virus free.
> --------------------------------------------------------------------------------------
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

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

Reply via email to