asynchronous - GWT - Where should i use code splitting while using places/activities/mappers? -


"core" refers to the initial piece of the loaded application.

  • To share URLs to locations, GWT placetoconizer & lt; P uses Place & gt; When loading the application from the URL, it calls the method P fixed position to get a new instance of the place to call it.

    Due to the asynchronous nature of the code, I can not create space inside a runAynync in this method, so I all in the core of my app Have to put

  • To link places for activities, the GWT call gets the activity (location location) (from com.google. Gwt.activity.shared.ActivityMapper ) to get a new instance of the activity.

    Once again, put me all my activities in the core.

    Here's what I want to try: Write a custom com.google.gwt.place .shared.Delegate that < Ul>

  • Auto-commit to PlaceChangeRequestEvent . If the app related to the requested location does not load, then it calls the event.setWarning (NEED_TO_LOAD_MODULE)
  • to the confirmation (string message) method When messages return NEED_TO_LOAD_MODULE (hence it does not bother the user) always return, and load the module through RunAsync Are there.
  • Once the module is loaded, goTo (requested place)

    Each bunch of activity in each app of my app And related scenes. Because the mappers are only called when PlaceChangeEvent is removed, I AppPiece.getSomeActivityInstance () .

    I can generate a new example of my activity. I'm pretty sure this will work, but what's upsetting me?

    • Searching for the apppease to load based on the requested location will force me to write the code that
    • Overriding delegate is difficult for this purpose, and I have a better solution

      You have all your activities main (as you call it): While an activity example is retrieved synchronously, it is allowed to start asynchronous The place where you used to call your GWT.runAsync calls.

      View and

Comments