My original motivation was like the String.format() case, but with
GwtQuery's $() function, since GwtQuery supported compile-time CSS selector
parsing, is was really tedious to add them to an interface when all you
wanted was $(".foo > h1.title") or some such. Later, when doing GWT
Exporter I noticed again code getting peppered with GWT.create() calls that
were not type safe. Finally, after seeing repeating patterns in this,
ranging from GWT RPC, to UiBinder, Editors, AutoBeans, Validators, etc I
came to the conclusion that GWT.create()'s inability to be wrapped in a
typed Java API and reliance on call-site inlining actually produced code
smell -- it prevents the design of APIs and instead causes people to
indulge in interface voodoo.
The reality is, I think people want to write code like $("css query") or
String.format(fmt, args...) or Mockito.mock(SomeClass.class).
The only real wave I've seen this made manageable with minimal boilerplate
is via the CDI stuff of Errai, but that kind of dependency injection I
think is pretty heavyweight for what GWT users want to do. It's like
imposing Guice/GIN on all GWT users.
On Sun, Aug 11, 2013 at 11:42 PM, John A. Tamplin <[email protected]> wrote:
> On Mon, Aug 12, 2013 at 2:29 AM, Goktug Gokdogan <[email protected]>wrote:
>
>> An example use-case would be implementing String.format when the format
>> string is a compile-time constant. I had a proof of concept mostly working
>> for this, but it was going to require more surgery to the compiler than I
>> was willing to do at the time.
>>
>>>
>>>
>> I didn't fully understand the example but it sounds like it requires way
>> more than today's deferred binding so I'm not sure it is a good use case
>> with replace-with/generate-with and static selectors. Perhaps it should be
>> better done with something like "evaluate-with" instead. Actually,
>> evaluate-with sounds interesting - I'll think about it :)
>>
>
> I thought we were talking about potential improvements to GWT.create, so
> it doesn't have to be something that can be done with today's
> implementation. Similar motivations were behind some proposals RayC made
> years ago as well.
>
> --
> John A. Tamplin
>
> --
> http://groups.google.com/group/Google-Web-Toolkit-Contributors
> ---
> You received this message because you are subscribed to the Google Groups
> "GWT Contributors" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors
---
You received this message because you are subscribed to the Google Groups "GWT
Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.