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].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.


Reply via email to