GWT - 要放入共享文件夹的内容是什么? [英] GWT - What to put in the shared folder?

查看:163
本文介绍了GWT - 要放入共享文件夹的内容是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我仍然不确定放入共享文件夹的内容。如果我正在执行RPC请求,并将Pojos从客户端发送到服务器,反之亦然,是否必须将它们放到共享文件夹中(因为它们被 - 客户端和服务器)。

错误的术语,但当我说 Pojo 我实际上是指 DTO

解决方案

您不必将RPC POJO放入共享文件夹中,但是如果将它们保存在 client 文件夹时,服务器将依赖于客户端软件包,因为Pojos由客户端和服务器使用。将客户端和服务器严格区分开来是一件好事,这就是共享文件夹的作用。



我将放入共享文件夹中:




  • RPC请求/响应 - I使用命令模式(gwt-dispatch)
  • 数据传输对象(DTO) - 用于传输数据的轻量级对象
  • 输入验证器 - 逻辑在客户端和服务器端进行验证时共享
  • 共享配置


I'm still unsure on what to put into the shared folder. If I'm doing RPC requests, and sending Pojos from the client to the server and vice versa, do I have to put them into the shared folder (because they are used by both - client and server).

EDIT

Maybe I've used the wrong term but when I said Pojo I actually meant DTO.

解决方案

You don't have to put the RPC POJOs in a shared folder but if you keep them in the client folder, the server would be dependent on the client package because the Pojos are used both by the client and the server. It's definitely better to have client and server strictly separated, and that's what the shared folder is for.

The stuff I would put into the shared folder is:

  • RPC requests / responses - I'm using the Command pattern (gwt-dispatch)
  • Data Transfer Objects (DTOs) - lightweight objects used to transfer data
  • Input validators - logic that is shared during client-side and server-side validation
  • Shared configuration

这篇关于GWT - 要放入共享文件夹的内容是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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