PDA

View Full Version : DTO's



ttbgwt
27 Jun 2008, 6:17 AM
Darrell,

Its a real pain to uses DTOs to get our data into BaseModel. Is there anyway just to use POJOS and not have to use BaseModel and create DTOs? I previously used gwt-ext and used their gwt-plus library which let us use POJOs. Any thoughts on this or words of advice?

sdc
30 Jun 2008, 8:22 AM
Hi,

This is an interesting point. You should post it in the Gxt: Open Discussion (http://extjs.com/forum/forumdisplay.php?f=33) forum

darrellmeyer
30 Jun 2008, 8:35 AM
I have published a new tutorial (http://extjs.com/helpcenter/topic/com.extjs.gxt.help/html/tutorials/dozer.html) (very simple) that demonstrates using Dozer to convert any java object into model instances. Using Dozer, you can map your DTOs to Models and then automatically, convert to and from. You would use Dozer to "transform" the object being sent and received from GWT RPC calls. Take a look and let me know what you think of this approach.

sdc
3 Jul 2008, 6:31 AM
http://extjs.com/forum/showthread.php?t=40165

damir222
3 Jul 2008, 8:48 AM
Darell,

I think the bigger problem is need to maintain two sets of classes, and no ide support for writing getters and setters that access map properties (?) (string constants are alse error prone).



.. btw gwt rpc implementation sometimes has problems with adding classes to .rpc file which are returned from methods (it works fine if I add field of the same type to model class).

D

zaccret
9 Jul 2008, 1:37 AM
The tutorial is nice and is helpful. But I agree that the main issue is related to the ModelData contract. Darell, this is unfortunately not the first post talking about it :
http://extjs.com/forum/showthread.php?p=190270
http://extjs.com/forum/showthread.php?t=40165
http://extjs.com/forum/showthread.php?t=40759

zaccret
16 Jul 2008, 4:35 AM
I REALLY prefer this solution : http://extjs.com/blog/2008/07/14/preview-java-bean-support-with-ext-gwt/

Nice !