使用 OSGi 和 GWT 的 Web 应用程序 [英] Web Application using OSGi and GWT

查看:23
本文介绍了使用 OSGi 和 GWT 的 Web 应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于使用 OSGI 和 GWT 作为 UI 的 Web 应用程序来说,哪个是好的架构?

Which is a good architecture for a Web Application using OSGI and GWT as UI?

目的是使用捆绑包来制作 Web 界面部分的捆绑包.如果我添加新包,它将在用户界面上添加新功能(例如菜单),与现有功能配合.

The aim is to use bundles to make bundles of web interface sections. If I add new bundle it will add new features (a menu for example) on the user interface, which cooperate with existing ones.

推荐答案

请参阅 GWT 邮件列表上的类似讨论 - http://groups.google.com/group/google-web-toolkit/msg/4a3f912cb89a7256

Please see a similar discussion on the GWT mailing list - http://groups.google.com/group/google-web-toolkit/msg/4a3f912cb89a7256

总结一下——GWT 的体系结构与您在运行时加载多个模块的要求是正交的.在 GWT 中有一些方法可以实现动态模块,但它永远不会是最佳的.

To summarize - GWT's architecture is orthogonal to your requirement of multiple modules loaded at runtime. There are ways to achieve dynamic modules in GWT, but it is never going to be optimal.

通常,您会为每个模块定义一个 javascript 接口,然后使用 GWT 导出器.然后,您将独立编译每个模块.然后模块将在运行时使用您导出的 javascript 方法进行交互.

In general, you would define a javascript interface for each of your modules, and then export those methods from GWT using GWT Exporter. Then you'd compile each of your modules independently. The modules will then interact at runtime using the javascript methods that you exported.

您付出的代价是性能.每个模块都会重复常见的框架代码(GWT+您自己的框架代码),您无能为力.

The price you pay is performance. Each module will duplicate common framework code (GWT + your own framework code), and there is nothing you can do to avoid it.

这篇关于使用 OSGi 和 GWT 的 Web 应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆