> > Is there a different pattern I should use? > The only pattern I have found working is the Async Package Pattern thats recommended by GWT. See http://code.google.com/events/io/2009/sessions/StoryCompilerGwtCompiler.html. Its around the second half of the video. You can also find it in the PDF slides for that presentation.
re. using a generic approach to split > Its been discussed before. See the following discussions - ` 1. http://groups.google.com/group/google-web-toolkit/browse_thread/thread/783cac72e23950d1/67580bea02318832%3C/span%3E 2. GIN and Async Callback - http://code.google.com/p/google-gin/issues/detail?id=61 --Sri 2009/12/25 Tristan <[email protected]> > Correction, the splitter looks like this: > > public class GenericSplitter { > > HashMap providers; // populated with Aprovider and Bprovider > > public void onSplit { > GWT.runAsync(new RunAsyncCallback(){ > ... > onSuccess(){ > MySuperclass sup = providers.get( AorBparam ).get(); > sup.doGeneric(); > } > } > } > > } > > On Dec 25, 12:00 pm, Tristan <[email protected]> wrote: > > Here is an example I am trying to code split: > > > > public class MySuperclass { > > > > public abstract doSpecific(); > > > > public void doGeneric(){ > > doSpecific(); > > } > > > > } > > > > public class A extends MySuperclass { > > > > public doSpecific(){ > > // do something for A > > } > > > > } > > > > public class B extends MySuperclass { > > > > public doSpecific(){ > > // do something for B > > } > > > > } > > > > The fun part happens when I do something to code split A and B. > > > > public class Splitter { > > > > public void onSplitA { > > GWT.runAsync(new RunAsyncCallback(){ > > ... > > onSuccess(){ > > A a = providerOfA.get(); > > a.doGeneric(); > > } > > } > > } > > > > public void onSplitB { > > GWT.runAsync(new RunAsyncCallback(){ > > ... > > onSuccess(){ > > B b = providerOfB.get(); > > b.doGeneric(); > > } > > } > > } > > > > } > > > > The SOYC has the following dependencies resulting in a trivial split > > (the method itself is split, but A and B are downloaded in initial > > download): > > > > A.doGeneric() -> MySuperclass.doGeneric -> B.doSpecific(); > > also > > B.doGeneric() -> MySuperclass.doGeneric() -> A.doSpecific(); > > > > I think I understand why that happens. But is this the desired > > functionality? Is there no way to add state information to the code > > splitter to determine which of the classes are calling the generic? > > This severely hinders code reuse. Is there a different pattern I > > should use? > > > > Thanks, Tristan > > -- > > You received this message because you are subscribed to the Google Groups > "Google Web Toolkit" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<google-web-toolkit%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-web-toolkit?hl=en. > > > -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
