作者:荷塘一只嫩藕 | 来源:互联网 | 2023-05-16 22:59
IamconsideringmakinguseofGWTasthefront-endtoanexistingwebapplication.我正在考虑使用GWT作为现有We
I am considering making use of GWT as the front-end to an existing web application.
我正在考虑使用GWT作为现有Web应用程序的前端。
I can't justify a complete rewrite to 100% GWT in one go. It is likely that I would migrate parts of the system to GWT gradually. However for consistency I would like to make use of the GWT TabPanel, MenuBar, etc as global interface elements from day one.
我无法一次性完全重写为100%GWT。我很可能会逐渐将部分系统迁移到GWT。但是为了保持一致性,我想从第一天开始使用GWT TabPanel,MenuBar等作为全局界面元素。
As an experiment to see how 'legacy' parts of the system could be incorporated, I have done the following.
作为一个实验,看看系统的“遗留”部分是如何被纳入的,我做了以下几点。
The application's main page template now loads a small 'wrapper' GWT module on every page. This GWT module looks for a selection of DIVs in the dynamically generated host page. If the DIV is found, a suitable widget is slotted into place, i.e. menuBar, tabPanel.
应用程序的主页面模板现在在每个页面上加载一个小的“包装器”GWT模块。此GWT模块在动态生成的主机页面中查找选择的DIV。如果找到DIV,则将合适的小部件插入到位,即menuBar,tabPanel。
A lot of the configuration for the included widgets can also be slotted into the host page as JSON structures. For instance, I have implemented an adapter that dynamically sets up a TabPanel in this way. I've also added some very simple widgets that load remote HTML, etc.
包含的小部件的许多配置也可以作为JSON结构插入主机页面。例如,我已经实现了一个以这种方式动态设置TabPanel的适配器。我还添加了一些非常简单的小部件来加载远程HTML等。
As a prototype, this all appears to work perfectly and loads quickly. However, it seems that GWT apps are really designed to be run from a single host page, not hundreds of dynamically generated ones.
作为原型,这一切看起来都很完美并且加载速度很快。但是,GWT应用程序似乎真的设计为从单个主机页面运行,而不是数百个动态生成的主机页面。
Can anyone highlight any issues that the above approach may run into, particularly as the GWT module increases in size? I would aim to keep the legacy wrapper module intentionally lean. Other functionality would be implemented in separate modules.
任何人都可以强调上述方法可能遇到的任何问题,特别是当GWT模块的大小增加时?我的目标是保持传统的包装模块有意识地倾斜。其他功能将在单独的模块中实现。
How have other people integrated GWT into their front end in a gradual fashion?
其他人如何以渐进的方式将GWT融入他们的前端?
2 个解决方案