I just started a project built using the new GWT archetype .
ActivityMapper looks like this:
public interface Factory { HomeActivity homeActivity(); GreetingActivity greetingActivity(String user); } private final Factory factory; @Inject MainActivityMapper(Factory factory) { this.factory = factory; } @Override public Activity getActivity(Place place) { if (place instanceof HomePlace) { return factory.homeActivity(); } if (place instanceof GreetingPlace) { GreetingPlace greetingPlace = (GreetingPlace) place; return factory.greetingActivity(greetingPlace.getUser()); } logger.severe("Unhandled place type: " + place.getClass().getName()); return null; }
Now I am trying to implement code separation using AsyncProvider based on this example , but I cannot get it to work.
What to do when using ActivityAsyncProxy? return ActivityAsyncProxy from getActivity (placement)? but then, how can I create ActivityAsyncProxy from the factory?
How would you recommend making the activity mapper play well with code splitting?
source share