We are trying another approach at the moment. We are generating source by 
doing some simple transformation of the model source we want to use in the 
browser. At the moment it is just regexp hack but we have had some success 
with javaparser ( http://code.google.com/p/javaparser/) although the 
project seems dead.

So it doesn't do much more than change the package name and change Foo into 
FooProxy (if we found a ProxyFor annotation)... 

So we don't need the extra layer of interfaces but the code to be shared 
needs to be self contained (not part of the entity class).

Anybody using a better solution?

If not any suggestions for code that can parse a level of Java the same (or 
better) than GWT AND then serialise that back into Java source (so IDE etc 
can look at the generated code)? The GWT parser would be great but no code 
to take the AST tree and produce Java source? The Eclipse code can do both 
but seems very hard to untangle from the workspace etc... 

Cheers

Sam

On Thursday, January 26, 2012 2:06:04 PM UTC, Thomas Broyer wrote:
>
>
>
> On Thursday, January 26, 2012 2:36:31 PM UTC+1, salk31 wrote:
>>
>> Where can I put code that works on the entity that I can use in the 
>> server and the client? 
>>
>> e.g. Person and PersonProxy with getSalutation, getFirstName, 
>> getLastName and I want getFullName to work on client and server... 
>> Where should this code live? 
>>
>> The only thing I can think of is to have a new interface PersonFoo 
>> with the getters in that Person and PersonProxy implement/extends. 
>> Then I can have something nasty like 
>> PersonFooImpl.getFullName(PersonFoo p).
>>
>
> That should work.
>  
>
>> I believe you can get the PersonProxy on the server too but I think my 
>> boss would balk at the server code being "contaminated" like this.
>>
>
> Plus, you'd have to create a PersonProxy instance wrapping your Person 
> object.
>
> No support for Person and PersonProxy getFullName with implementation 
>> on the client? e.g. @IPromiseYouCanCompileThisForClient getFullName() 
>> in the proxy interface?
>
>
> No. 
>

-- 
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/-/Y9InB-bW8HkJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to