It might be that my memory is wrong but I thought we first try/check
the (class, param) constructor and only if not present we call the
default constructor. At least that is how it used to be. And because
of that the orginal tests were ok - no bug IMO. The reason why I don't
like the change is because now you always need both constructors if
your Page accepts additional url parameters. One is called if no
params are present and the other if there are. I mean the solution for
the user is simple, you just call the constructor with params = null,
but I would assume you break a lot of apps and its is more
"complicated" for users than it used to be. I definitely prefer the
sequenced approach

Juergen

On 1/14/06, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> hey guys, while helping pepone pepone on the user list ive come across a
> bug. most of the time when we instantiate a page we do it using a wrong call
> to the pagefactory. most of the time we use newPage(class, PageParams) even
> though page params are empty and so the newPage(Class) should be used
> instead which invokes the default constructor.
>
> i went through all the places i could find and basically did this
> if (pageparams.size()==0) { page=newPage(class); } else {
> page=newPage(class, pageparams); }
>
> and then a lot of tests broke because they depend on wicket calling the
> wrong constructor! so i had to go and fix all those. i would say 90% of all
> test pages were expecting to be instantiated with the wrong constructor,
> probably because they were copied and pasted most of the time.
>
> while doing all this and discussing it with eelco we agreed that it might be
> better to change ipagefactory to only have one constructor: (class,
> pageparams) and allow pagaparams to be null. the rule would be simple: if
> page params==null||pageparams.size()==0 use the default
> constructor, otherwise use the pageparams one.
>
>
> what do you think?
>
> -Igor
>
>
>


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop

Reply via email to