On Fri, Jul 27, 2012 at 2:37 PM, Martijn Dashorst
<[email protected]> wrote:
> On Fri, Jul 27, 2012 at 1:10 PM, Martin Grigorov <[email protected]> wrote:
>>> It looks like an API addition, so that can go in 6.1 (unfortunately,
>>> AjaxRequestTarget is now an interface, so it might have to wait until
>>> 7)
>>
>> I'd use 'fortunately' because now I can setup my own impl that has
>> these additional methods and I'm able to provide my own wicket-ajax.js
>> with the needed additions ;-)
>
> But that will introduce the need to add instanceof's and
> (MyAjaxRequestTargetWithAdditionalMethods) casts. Whereas you can just
> add the methods to the class without breaking current implementations
> against the interface. Now we can't add this to 6.1 (without casts and
> instanceofs) because it breaks API.

I meant that I can setup custom ART impl in mine application
(WebApplication#newART()).
So there is no need of instanceof, just cast and call the new method.

I'm sure that no one will actually do this, because it is part of the
internals and its maintenance cost will be too high.

>
> Before we start painting the bike shed, it's unfortunate that we don't
> have Java 8 to do this properly. Wicket 8?

I guess you talk about SAMs ?
I'm not sure that this will help because you receive a live instance
of ART in onXYZ() and it is too late to extend it at that time.

You can use Scala instead. An implicit conversion could help.

>
> Martijn



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

Reply via email to