Christien,
On our project which is about the size of yours, we have an *Interfaces* Maven
project. Our GWT project makes no direct references to the Services project
and visa versa. This way the issue of making the sources available is a
non-issue. We use Spring4GWT <http://code.google.com/p/spring4gwt/> to
wireup GWT->Service RPC calls using the interfaces in the Interfaces
project. Thus the build order is (1) Interfaces, (2) GWT, (3) Services.
So there is an interface for the service in the Interface project
@RemoteServiceRelativePath("springGwtServices/marketService")
public interface MarketService extends RemoteService {
MarketDTOContainer getMarketData(Date begin, Date end)
So a GWT module references an async interface seen below. Now you can
access your service just fine from GWT.
This interface has all the methods of the above interface, but the return
value is wrapped in an async callback.
public interface MarketRiskServiceAsync {
void getMarketData(Date begin, Date end, AsyncCallback<MarketDTOContainer>
async);
..
The actual service uses an annotation to tell Spring where to find it for
wireup with a name matching that in the interface.
@Service("marketService")
public class MarketServiceImpl implements MarketService { ...
There is a one off config to setup the servlet mappings:
<servlet>
<servlet-name>springGwt</servlet-name>
<servlet-class>org.spring4gwt.server.SpringGwtRemoteServiceServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>springGwt</servlet-name>
<url-pattern>springGwtServices/*</url-pattern>
</servlet-mapping>
Clearly your project is well along, but you might find this pattern useful.
While it looks like a lot of interfaces, in many cases we just add another
method to a service interface and we're done. We also like the DTOContainer
patter since we can pass another parameter along with an existing request
by just adding it to the container class.
Hope this helps you or others with similar issues.
Sincerely,
Joseph
--
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/-/WhKIPo9g4koJ.
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.