On Sunday, March 6, 2011 9:51:11 PM UTC-8, 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 ? >
I'm looking at this as if Entitiy/Value classes on the server implement EntityProxy/ValueProxy interfaces declared by the client. Even though Entitiy/Value classes do not implement the interfaces using Java *implements * keyword, the implementation is enforced by the GWT compiler. This makes the server classes completely decoupled from the client interfaces while the contract is being enforced at the same time. This system is more flexible then Java-based implementation because it allows using legacy server classes with the new GWT applications. And if writing interfaces by hand is tedious there is always a generator option (as Thomas suggested and as already implemented by Spring Roo) > > 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) ? > > Thank You > -- 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.
