Dne pátek, 8. června 2012 16:48:47 UTC+2 Thomas Broyer napsal(a):
>
>
>
> On Friday, June 8, 2012 4:14:44 PM UTC+2, zorro wrote:
>>
>> Well, I have the requestFactory-apt set as annotation processor. But 
>> maybe problem is that the type that I wanted to create on server is an 
>> interface! And this is not covered by compiler at all!
>
>
> Would you mind filing an issue on the tracker?
> (DomainChecker should check that the type is instantiable, i.e. neither an 
> interface or an abstract class –or an enum!)
>

Actually, it would make sense that type is an Interface if used together 
with "locator". What do you think?
In my case I am using valueproxies only, since I am only sending "packages" 
of data that do not "live" on themselves on the server.

>  
>
>> Can I say to this magical RequestFactory stuff say what type to 
>> instantiate on the server, if interface is allowed (apparently) in the 
>> ProxyFor annotation?
>>
>
> You can use a Locator (on server-side, responsible for "instantiating your 
> interface") and link to it from the ProxyFor annotation.
>
> https://developers.google.com/web-toolkit/doc/latest/DevGuideRequestFactory#locators
>  
>
>> I woudl really appreciate that because I am using interfaces to get rid 
>> of tuns of necessary copying among proxy objects and real gwt objects. My 
>> original intention was to use gwt so I can move functionality execution 
>> easily from server to client. Therefore RF proxies in my case should be the 
>> same as the domain objects. Therefore interfaces.
>>
>
> In your case, I'd make sure to reference the real domain object (that 
> implements the same interface that the proxy extends).
> I suppose that's what you were willing to do, but somehow forgot to change 
> the ProxyFor value during the refactoring, and the bug in ValidationTool 
> didn't tell you you were wrong, right?
>

You are absolutely right here:- But I need to reference interfaces, cause 
this allows me to make types of proxies and my JSO objects more adjacent 
and thus save me some code. E.G. At least I can save some handcrated:- 
copying like this:

List<SyncItem> toServerItems = syncPushToServer.getItems();
        serverPush.setItems(new ArrayList<SyncItemProxy>(toServerItems)); 

I have 
1.     public class SyncItem implements Serializable, ISyncItem {
    @ProxyForName(value = "com.roamtopix.shared.SyncItem")
    public interface SyncItemProxy extends ValueProxy {
       ..a lot of setters/getters
    }

2.  @ProxyFor(IWindow.class) 
   public interface WindowProxy extends ValueProxy, IWindow {
       ..NOTING, everythig is on IWindow
   }

Difference between 1 and 2 is in what direction I need to "copy" objects on 
the client (from proxy to gwt-normal or JSO to gwt-normal or to gwt-proxy)
And can go with it. However I need interfaces to work in @ProxyFor annot. 
In my case IWindow is an interface. If I find out that this does not work 
wint EntityProxy I fill in that bug. 


 

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