Igor:

>that doesnt really help much as it only works for that one compnent
class. it is much nicer to have one global solution such as
>MyApplication.get(). but thats just my two cents.
>
>-igor
>
>>On Sun, Jun 15, 2008 at 1:15 PM, Stefan Lindner <[EMAIL PROTECTED]>
wrote:
>> Why is the Component's getApplication method final? In formwer Wicket

>> versions I could have
>>
>>        class MyApplication extends Application.....
>>
>>        class MyComponent {
>>                public MyApplication getApplication() {
>>                        return
(MyApplication)(super.getApplication());
>>                }
>>        }
>>
>> This made life a bit easier.
>>
>> Stefan

That might be your "two cents", but is there a real reason why
getApplicationis final? :-)
We have a lot of generic Pages like

        public abstract class VWebPage<T, A extends Application, S
extends Session> extends WebPage<T> {
                @SuppressWarnings("unchecked")
                public A getMyApplication() {
                        return (A)(super.getApplication());
                }
        }

and application pages like

        public abstract class MyAppsWebPage<T> extends VWebPage<T,
MyApplication, MySession>{

                public MyAppsWebPage() {
                        super();
                }

                public MyAppsWebPage(final IModel<T> model) {
                        super(model);
                }
        }

A concrete Page or an Application then is

        public class MyRealPage extends MyAppsWebPage<MyClass> {
                ...

                getApplication().callMyApplicationsMethod
        }

This might not be Wicket's intended way to use getApplication But is
there a real serious reason to make getApplication final? Which problem
so I run into when I use this pattern?

Stefan

Reply via email to