Hello, I am trying to design the architecture of an application that uses GWT and am struggling with the connection between my persistence & logic layer and the GWT presentation layer. I think I have not yet read and/ or understood enough about GWT and hope that somebody can point me into the right direction.
My app's persistence layer is JPA (Hibernate) and in designing my logic (business) layer, I have tried to follow an OO design in which my domain objects are more than "stupid" data containers but instead contain business logic where appropriate -- i.e., I am trying to avoid an anemic domain model [1,2]. As a consequence, my service layer is rather thin and most logic is realised by the entities themselves. My question: What approaches exist to integrate GWT into such an architecture? I have read through "Using GWT with Hibernate" [3] and it seems that all of the approaches mentioned there (DTOs, Dozer, Gilead) rely on "powerful" services. So for example, while my entity Book has a method getAuthors(), these frameworks "suggest" to do a service call bookService.getAuthors(callback). I like the advantages [1] of having intelligent domain objects, so I am wondering whether people have for instance thought about on-the-fly transforming the domain objects (Book) to light-weight async objects (BookAsync) so that one can call book.getAuthorsAsync(callback) if one has configured the method getAuthors() as "lazy". (This would eventually call a service in the background, of course, but one that is generated automatically by the framework.) Are there approaches like this? Basically, I have the same problem like other posters [4]: I would like to avoid writing lots of boilerplate code, like DTOs that mostly duplicate my existing domain class hierarchy, or services that are merely wrappers of method calls on my entities. In my experience having these additional layers makes the application unreadable and less agile as even a small change (like adding a parameter to an entity method) entails tons of "syntactial" changes in all the services, etc. Thanks for any pointers, Kaspar [1] http://en.wikipedia.org/wiki/Anemic_Domain_Model [2] http://groups.google.ca/group/EtoE/browse_thread/thread/cac1eafe15f06f5b/7db829b9dacc59ab%237db829b9dacc59ab?sa=X&oi=groupsr&start=0&num=3 [3] http://code.google.com/webtoolkit/articles/using_gwt_with_hibernate.html [4] http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/1035e0e677efac06/14e430525a734e99 --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
