Frustratingly, as I know I'm so close, all my entities (both the
implementation and the interface) only contain getter and setter
(simple POJO for use in Hibernate). All my data access methods
currently reside in the entity service, as recommended. Now in the
entity service, I could do a horrible cast from the interface back to
its implementation and send that back to the client. However I have a
custom ServiceLayerDecorator, to use Spring to create my Locators (for
the find method), and hence I can override the following...

    @Override
    public <T> Class<? extends T> resolveClientType(Class<?>
domainClass, Class<T> clientType, boolean required) {
        ProxyFor a = clientType.getAnnotation(ProxyFor.class);

        if (a != null && a.value().isAssignableFrom(domainClass)) {
            return super.resolveClientType(a.value(), clientType,
required);
        }
        return super.resolveClientType(domainClass, clientType,
required);
    }

Do you see any problems with this approach? It works for the above
example.

John

P.S. Also using a ServiceLocator to intergrate with Spring. Spring and
GWT play nicely together now.

-- 
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.

Reply via email to