简体   繁体   English

GWT应用程序中的多个入口点:自举,历史令牌和位置管理如何工作?

[英]Multiple entry-points in GWT Application: How does bootstrapping, History-Token and Place-Management work?

I have now splitted up my application into two major modules: 现在,我将应用程序分为两个主要模块:

  1. Admin area 管理区
    Anything that is related to the administration area for some certain users. 与某些特定用户的管理区域有关的任何事情。
  2. Landing page area 到达网页区域
    The landing page for public users. 面向公共用户的登录页面。

The reason why I have done this is because maybe one day it will be just easier to develop in two separate projects where each of them should be able to run as a standalone. 之所以这样做,是因为也许有一天,在两个单独的项目中进行开发会更容易,在每个项目中,每个项目都应能够独立运行。 Therefore both modules do have their own EntryPoint . 因此,两个模块都具有自己的EntryPoint

The things I am not sure about is how to handle eg the history and places of both of them. 我不确定的是如何处理它们的历史和位置。 I am definitely going to have at least two ActivityManager to handle the different places of both modules but how can I eg separate the PlaceHistoryMapper into both modules? 我肯定至少要有两个ActivityManager来处理两个模块的不同位置,但是如何将PlaceHistoryMapper分成两个模块?

Another thing I am not sure about is how I could bootstrap this application as such that each module is still able to run without the other. 我不确定的另一件事是如何引导该应用程序,以使每个模块仍然能够在没有其他模块的情况下运行。

And talking about bootstrapping: Can somebody tell my in which order onModuleLoad() is getting called? 并谈论引导程序:有人可以告诉我onModuleLoad()的调用顺序吗? How can I make sure eh that running "main" EntryPoint gets executed first in order to initialize everything correctly before the others are getting called? 我如何确保运行“主” EntryPoint被首先执行,以便在调用其他主程序之前正确初始化所有内容?

Short answer: don't do that (that just won't work, at least not without a considerable amount of error-prone work). 简短的答案:不要那样做(那是行不通的,至少没有大量容易出错的工作就行了)。

If you want to make it easier to split the project in two in the future, just make it modular. 如果您希望将来更轻松地将项目分成两部分,只需将其模块化即可。 That's exactly what Activities are about. 这就是活动的意义所在。

Your PlaceHistoryMapper and ActivityMapper s are specific to one application, they're about how you tie everything together. 您的PlaceHistoryMapperActivityMapper特定于一个应用程序,它们与如何将所有内容捆绑在一起有关。
You can modularize them by making them delegate to other PlaceHistoryMapper s and ActivityMapper s. 您可以通过将它们委托给其他PlaceHistoryMapperActivityMapper来对其进行模块化。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM