On the GWT project on which I am working we have dependencies to some 
common utility methods from libraries that are to be used by other modules 
for their business logic in order to avoid code redundancy.
e.g. : the logic used for calculating a gross price based on a set of given 
parameters (netto price, tax, promotion type) is used on the GWT client 
side for displaying the cost information as well as on the webservice side 
before persisting the data.

This is the reason why we are currently defining several common libraries 
(along with their dependencies - e.g. : hibernate) as a dependency for our 
web application.

One idea I have in mind to avoid the unnecessary dependencies in the web 
application is that during the building process all the utility classes 
from the common libraries that are neded in the GWT application could be 
copied in another project (e.g. : my-gwt-application-utilities), and  in 
this way the GWT application to have only this project as dependency. 
Downside is that the  same code would exist in two places, upside would be 
that the unnecessary dependencies problem would be solved.

Projects with their dependencies before this operation :
*SERVICE SIDE*
- *mycompany.services.utilities* (java utility project)
    - jasper       
- *mycompany.services* (webservice project - contains among other generic 
cost calculation methods)
    - mycompany.service.utilities
    - hibernate
    - ...
- *mycompany.services.gen* (webservice stubs projects)
*CLIENT SIDE *
- *mycompany.mygwtapp* (gwt application communicating over SOAP/REST with 
mycompany.services)
     - mycompany.services
     - mycompany.services.gen
     - jasper
     - hibernate
     - ....

If there would be the artificial gwt project created to contain the common 
classes the project structure would look like this:
*SERVICE SIDE*
- *mycompany.services.utilities* (java utility project)
    - jasper       
- *mycompany.services* (webservice project - contains among other generic 
cost calculation methods)
    - mycompany.service.utilities
    - hibernate
    - ...
- *mycompany.services.gen* (webservice stubs projects)
*CLIENT SIDE *
*- mycompany.mygwtapp.utilities* (contains the utility classes needed by 
mycompany.mygwtapp project copied during the build process from 
mycompany.service.utilities and mycompany.services projects)
- *mycompany.mygwtapp* (gwt application communicating over SOAP/REST with 
mycompany.services)
     - mycompany.mygwtapp.utilities
     - ....


This is one  (maybe naive) approach on which I've been thinking to tackle 
this issue.
Can anybody provide me some feedback on how they've tackled with this issue 
(putting the utility classes in separate projects to be used by the 
business logic and GWT wouldn't necessarily work in my case)?

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/98SZRrB7HQ0J.
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.

Reply via email to