GWT应用程序的最佳体系结构 [英] Best architecture for applications in GWT

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

问题描述

我现在开始研究GWT,并且有一个非常普遍的问题,我可以用更多的经验教我自己,但我不想从错误开始,所以我决定问你。 p>

我总是使用JSF进行开发,为bean,控制器和managedbeans分开安装。

然而,由于GWT使用RPC,我不会有managedbeans,对吧?
所以,GWT会自动为我处理用户会话,还是我必须自己做?

该项目的最佳包装结构是什么? p>

最好使用RPC,或者创建一个webservice并访问GWT中的webservice?



很难托管应用程序在tomcat服务器上?



是否有测试说明哪个服务器对GWT更快?



谢谢你。


解决方案

 然而,由于GWT使用RPC,我不会有managedbeans,对? 

确实,GWT RPC使用POJO。

 因此,GWT会自动处理用户会话,还是我必须自己做? 

GWT是纯粹的AJAX应用程序 - 客户端代码(通常)运行在一个浏览器窗口中(类似于gmail)并不会重新加载网页。这意味着应用程序状态总是存在 - 不需要会话(作为保存状态的一种手段)。您仍然可能需要用于用户身份验证的会话,但这通常由servlet容器处理。

 什么是最佳的包结构项目? 

三个包:客户端 server 共享客户端用于GWT客户端代码,服务器用于服务器(也是RPC)代码和共享 code>用于客户端和服务器使用的POJO。

 最好使用RPC,或者创建一个web服务和访问GWT中的Web服务? 

使用GWT-RPC或者(更好,更新)的RequestFactory。

 很难在tomcat服务器上托管应用程序? 

很简单:GWT客户端代码被编译为JS / html并作为任何静态内容托管。 RPC服务器代码只是Servlets - 正常的web.xml注册。

 是否有测试说明哪个服务器对于GWT更快? 

没有线索,但恕我直言并不重要,因为大部分延迟都来自数据库和网络。

I'm starting to study GWT now, and have a very general question, I could maybe teach myself with a little more experience, but I don't want to start it wrong, so I decided to ask you.

I always develop using JSF, having separate packages for beans, controllers and managedbeans.

However, as the GWT uses RPC, I will not have managedbeans, right? So, GWT automatically handles user session for me, or do I have to do it myself?

What is the best package structure for the project?

It is best to use RPC, or create a webservice and access the webservice in GWT?

It's hard to host the application on a tomcat server?

Is there a test saying which server is faster for GWT?

Thank you.

解决方案

However, as the GWT uses RPC, I will not have managedbeans, right? 

True, GWT RPC uses POJOs.

So, GWT automatically handles user session for me, or do I have to do it myself?

GWT is pure AJAX APP - client code (normally) runs in one browser window (similar to gmail) and does not reload the web page. This means that the application state is always there - no need for sessions (as a means of saving state). You still might need sessions for user authentication, but this is usually handled by servlet container.

What is the best package structure for the project?

Three packages: client, server and shared. Client for GWT client code, server for server (also RPC) code and shared for POJOs that are used by both client and server.

It is best to use RPC, or create a webservice and access the webservice in GWT?

Go with GWT-RPC or (better, newer) with RequestFactory.

It's hard to host the application on a tomcat server?

It's straightforward: GWT client code is compiled to JS/html and is hosted as any static content. RPC server code is just Servlets - normal web.xml registration.

Is there a test saying which server is faster for GWT?

No clue, but IMHO does not matter, because most of the latency will come from database and network.

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

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