what about pages that are constructed with the new operator? the users then
have to explicitly call commoninit() from their constructors? i think that
is horrible. what we need to do is somehow delay the getvariation() until
render time.

-igor


On 3/27/07, Chris Colman <[EMAIL PROTECTED]> wrote:

Just looking at the source code for WebPage it looks like a very minor
change to achieve a more flexible lifecycle initialization phase.


All the WebPage constructors call

        private void commonInit()

As you will no doubt understand this is being called before
construction/instantiation has properly completed - which has serious
consequences if any methods are called that rely on constructor
initialization that has not yet occurred (eg., getVariation that returns
a variation based on the constructor's parameter values).

I think the following changes would fix this problem and allow
getVariation() to work properly when it's implementation relies on
parameters passed into the constructor:

1. Remove all calls to commonInit() from the WebPage constructors.
2. Make commonInit public
3. Change the DefaultPageFactory to explicitly call commonInit on any
new page that it instantiates.


These changes, to my thinking, are quite simple with low to no ripple
effect and they allow wicket users to avoid entry into the 'world of
pain' that is 'partially constructed objects'.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to