On Monday, March 7, 2011 6:51:11 AM UTC+1, zixzigma wrote: > > It is often recommended that, it is a good practice, for components, > such as client/server communicate through interface. > > when working with RequestFactory, > we need to define RequestContext, which makes use of Entity/Value Proxies. > these are all interfaces. > > however, Server side code, cannot implement this RequestContext interface. > server-side code, has no notion of RequestFactory, EntityProxy, etc. > > in other words, client and server do not implement the exact same > interface, > they use a conceptually equivalent interface, but it is not the same. > > if we think of client/server being separate projects, > how can we enforce the contract ? >
Generate one from the other? There's also RequestFactoryInterfaceValidator<http://google-web-toolkit.googlecode.com/svn/javadoc/2.2/com/google/gwt/requestfactory/server/RequestFactoryInterfaceValidator.html> > I would like to have a shared interface FooService, declaring my services > or DAOs, (findFooBy(id)) > and use > ClientFoo implements FooService > ServerFoo implements FooService > > ClientFoo uses RequestFactory related code, > ServerFoo, a serverside framework > but these two communicationg through SAME interface, not conceptually > similar. > is this possible ? (I'm afraid it is not, what can be done to minimize the > impact) ? > It won't work, because the client-side has to have a Request<X> return type when the server side returns X. And for proxies vs. domain objects, it can only work when you don't reference other objects (as the client would have to reference the proxy and the server the domain object). -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
