Hello Aaron, many people advocate using lightweight domain models for use in your client side code. Also people have suggested making a "shared" package that exists at the same level as your client and server, which holds your DTO's that you use in both server and client side, to avoid the server side from referencing client package objects (it feels cleaner). Any such source packages you add beyond the client needs to be referenced in your gwt.xml.
As for your 3rd party lib, I don't see why you can't use the full blown objects on the server side only. So yes, you would need to find a way to transform your DTO->Full Object and possibly back. I've seen this done in the DynamicJasper gwt sandbox app where they convert a lightwight Color class to a SWT Color, and a lightwight group and column into the respective DynamicJasper objects. Granted, it's not refactored in a pretty way, but the "transformXtoXPrime" type methods are there. They put all theirs in the servlet and they only needed one way translations. In case there is any confusion, it's the lightweight versions that are used in the client side code, and they are basically Serializable pojos. Annotations on your client classes don't break things in and of themselves. If they produce a proxy object that GWT can't handle then that is a problem. I think this is what happens if you try to use regular Hibernate with your client side objects. However, GXT (a 3rd party lib for GWT) uses a bean marker annotation to generate a gxt BeanModel from your marked pojo during compile time. I would say searching the past posts on the lists will solve 75% of your issues, the other 10% being blogs on gwt, and 9% being google code search for existing gwt apps...so if you are pressed to find a quick solution those are the resources I'd use. On Tue, Jun 16, 2009 at 5:49 PM, Aaron<[email protected]> wrote: > > Hi Everyone, > > I'm new to GWT and I'm very excited to start using it in a large > enterprise application I'm working on. I have inherited an existing > domain model that is available to me in a jar. I can build that jar > with the source code included as well. > > Ideally, I'd love to be able to work with my domain objects when > writing my GWT client code. I have discovered it is not as simple as I > had hoped. > > I went ahead and created a GWT module for my classes and inherited > that module into my GWT project. > > When building my GWT project, I received GWT compiler errors about not > having source code available for a dependent library we use > (com.vividsolutions.jts)... I can get the source if needed, so no big > deal. > > Then I got errors related to javax.xml.bind annotations used in our > classes: 'The import javax.xml.bind cannot be resolved' and > 'XmlAccessorType cannot be resolved to a type'. I'm having more > trouble figuring out what the solution to that problem is. > > Any suggestions on the specific issues I just mentioned would be > greatly appreciated, but I'm also interested in getting your feedback > on, at a high level, what is the best approach when integrating more > complex classes into a GWT project? Is it possible and worth it to > track down the source code for every dependency your project has? Are > annotations in your classes a problem in GWT or is there a way to deal > with that? Is it better to write some 'simple' versions of my domain > classes for use with GWT and then write code to convert back and forth > between the two? Or, is a Json or XML service the simplest? > > Thanks for any comments you have. GWT is an exciting project and I > know it will be well worth my time figure this out. > > Aaron > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---
