Okay, that's kind of clear. Async Package (gateway class) looks nice,
but how does it fit within Gin and DI?
On Oct 26, 4:24 am, Sripathi Krishnan <
sripathi.krish...@gmail.com>
wrote:
> Maybe somebody from google will confirm this, but I doubt you are going to
> achieve code splitting by using proxies or interfaces, or by using any
> generic parameterized approach.
>
> A piece of code will end up in split-point-1.js *only if* it is always being
> used from within GWT.runAsync(). If a class can be used from two separate
> GWT.runAsync() method blocks, it is going to end up in the left-overs block.
>
> Now here is my understanding of the situation (of course I may be wrong) -
>
> - You have two instances of the class AsyncLoader, say LoaderA and
> LoaderB, with two unique providers - say ProviderA and ProviderB
> - GWTC recognizes that there will be two GWT.runAsync() blocks, which is
> why it creates two split points
> - But it cannot guarantee that LoaderA will always get ProviderA, and so
> it should put the code for ProviderA in split-point1.js
> - So, it knows that the entry point is not using ProviderA or ProviderB -
> which is why it is not in the initial download fragment. But it cannot
> guarantee it will always be used from a unique code fragment, which is why
> it ends up in the left-over fragment.
> - When you use the inline implementation, you will hard-code the actual
> provider - and hence things will work.
>
> The only pattern that works well is Googles recommended "Async Package
> Patter". See this
> presentation<
http://dl.google.com/io/2009/pres/Th_1045_TheStoryofyourCompile-Readi...>.
>
> --Sri
>
> 2009/10/25 skrat <
dusan.malia...@gmail.com>