Looking at the GWT sample apps and the RPC tutorial the following package conventions are used:
./client/GreetingService.java
./client/GreetingServiceAsync.java
./server/GreetingServiceImpl.java
Though the GWT docs are very sparse on best-practices what components get included where at runtime, the clear intuition is:
This would lead one to believe that code in client should not be on the compile-time sourcepath of javac. Yet since GreetingServiceImpl implements GreetingService, clearly code in client needs to be on the sourcepath during compilation, and included on the runtime classpath at deployment.
Given this, why doesn't the GreetingService interface go in shared?
If you try to put it in shared, the GWT Eclipse Plugin complains "Missing Asynchronous Interface"...
Let's try to be clear :
Service interface must be available to your client code. So it must either be in the client package or the shared package. But the ServiceAsync interface must be in the same package as the Service interface. And the ServiceAsync is certainly not something that is considered shared between client and server. So the ServiceASync interface should be in the client package.Service interface is put in the client package.ServiceASync interface was not found in the Service interface package.Does that answer your question?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With