Tuesday, November 6, 2012

Re: GWT 2.5 RC2 EntityProxy Validation



On Monday, November 5, 2012 9:31:30 PM UTC+1, Jens wrote:
Ouch! Totally forgot that you have to return the proxy on client side :( Well in that case you probably have to duplicate your validation annotations or implement the proxy interface in your entity as mentioned above. I would go with duplication as the entity shouldn't be a proxy. It should be relatively easy to write a small generator tool that generates proxies for your entities and copies all validation annotations to the proxy interface. Maybe someone has already done it on github/google code.

Couldn't you simply override the methods and refine the return type? (Java has covariant return types)

interface Employee {
  Employee getBoss();
}

interface EmployeeProxy extends Employee, EntityProxy {
  EmployeeProxy getBoss();
}

class EmployeeEntity implements Employee {
  @Override
  public EmployeeEntity getBoss() { … }
}

--
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/-/NKdCosg2Z-4J.
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.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate