开发者

Gilead vs RequestFactory for GWT

What are the pros and cons for each? Which is your开发者_如何学运维 favorite?

Thanks.


Peter Knego lists out 3 disadvantages of RequestFactory here.

I tried RequestFactory for our own project but decided to abandon it for the following reasons:

  1. RequestFactory can not be used to transfer Maps. Old plain GWT-RPC can do it.

  2. You have to manually write proxy interface for every entity. This is like writing DTOs – there is a lot of duplicate code.

  3. When writing proxy interfaces, there is no type-safety: for every property in entity there is corresponding method in proxy interface. This has to be managed manually. When project evolves there is bound to be changes to entities. Developers have to keep this in mind and sync code manually, which is error prone.

In GWT there is now a new option to do custom serialization without DTOs or super-sourcing: CustomFieldSerializer.

I used this to serialize datastore’s Entity (used by objectigfy’s @PrePersist/@PostLoad)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜