i'm not sure what i think about this yet.  can you show us the
exact code modifications and use cases you have coded up?
(boiled down to the important parts, if possible)  also, it would 
be good if you could explain how this solves any problems 
other than getVariation().


Chris Colman 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
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wicket-user
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Lifecycle-issue-with-getVariation-tf3476789.html#a9724558
Sent from the Wicket - User mailing list archive at Nabble.com.


-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to