i got maybe a stupid issue on using entity classes on GWT pages. It is said that to show some class on GWT pages, this class must be defined within package of GWT client app. E.g. GWT application under com.foo.clinet can use only classes defined in this package and its subpackages to be shown in the components (like GWT grids, labels…)
But what if you got some other project where you have defined those entites, typically EJB (imagine structure web project, ejb project). You are able to recieve those entites via RPC service but then you cannot use them in the components (simple adding jar of this project wont help). The first possibility is to transform them into some other value object with more or less same attributes but defined in this web project. But this is code duplication which is never nice because simply when you change entity, you have to change correspoding view value object. There are surely few options how to do such things automatically (e.g. via reflection which is sadly slow…).
So the question is, is there some typical elegant solution or design pattern how to solve this without code duplication? Thanks a lot
I maybe found solution but im not sure if it is right one.
I will specify my problem a bit more precise. I got this structure.
and want to include
MyClass.javato GWT compiler WITHOUT need to move it anywhere.I just defined that
/MyApp/Ejb-modulebuild will include also*.javafiles and then in/MyApp/Web-module/a/bI addded Inclusion.gwt.xml where I putand updated
MyApp.gwt.xmlwith