Inside a GWT application we have a "shared" package which contains, as its name implies, objects shared between client-side and server-side code. We have a multi-module maven project:
+ server
| |
| + businessLogicPackage
|
+ gwt
|
+ client
|
+ server
| |
| + converter
| |
| + rpc
|
+ shared
Each time I need to reuse a shared object in the server module, I need to convert the shared object using some converter located in gwt/server/converter. I tried to use inheritance and have the shared objects inherit classes from the server/businessLogicPackage, thinking I could get away with a simple casting operation. This produces an error. Obviously GWT can't compile the sources from an external module.
> No source code is available for type server.businessLogicPackage.x; did you forget to inherit a required module ?
Knowing that:
- We are manipulating a huge quantity of "shared" objects
- I want my business logic to remain in a separate module so I can reuse it elsewhere
- I don't want to write all those converters
Could anyone share some best practice / alternative with me ? What's trendy now in 2014 ?