Thursday, January 26, 2012

Re: With RequestFactory where do utility methods etc live



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

No comments:

Post a Comment