Hi! I have the same problem and after solving the issue and reading this
posts I have some opinions I will like to share.
I think this is a conceptual problem. RequestFactory cant solve the
parent hierarchy because of multiple inheritance of interfaces. If you have
a class "class A implements B,C", which domain type will be the parent? If
you assume that the solution must be to define a concrete superclass. So I
try two options.
1. Change the interface and use an abstract class with all methods
abstract. This is quite simple and solves the problem instantly. But, if
you need an interface because of multiple inheritance in some class of your
code this is wont be an option.
2. Explicitly define wich of the interfaces is the parten of the domain
object. This is my preferred option. I create a annotation named @Parent
(also @ChildOf might be used), exactly like @ProxyOf but used in the
server-side. So you can define the implementation class as
"@Parent(SomeEntity.class)
class SomeEntityImpl implements SomeEntity, SomeOtherInterface...". Finally
I extends the resolveClientType method in my application service decorator.
@Override
public <T> Class<? extends T> resolveClientType(Class<?> domainClass,
Class<T> clientType, boolean required) {
Parent parent = domainClass.getAnnotation(Parent.class);
if (parent != null) {
return getTop().resolveClientType(parent.value(), clientType,
required);
} else {
return super.resolveClientType(domainClass, clientType, required);
}
}
On Saturday, January 15, 2011 2:28:57 PM UTC+1, John Maitland wrote:
>
> Thanks for the advise. After using getTop().resolveClientType this
> open up further compilications, not least a circular dependency in the
> layers. However, the next problem was intergrating this with a custom
> Locator, which resolves the domain class with the BaseProxy and not
> the actual proxy for the domain class (therefore above code doesnt
> work with BaseProxy). Therefore I put in a further cache map the
> ProxyFor class to the client class.
>
> Problem solved!
--
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/-/juwlVJ4wC_sJ.
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.