Re: RequestFactory Best Practices: How to share object between client and server

2011-08-06 Thread br22
Thank you Ryan and Ben.

On Aug 4, 2:45 pm, Ryan McFall mcfall.r...@gmail.com wrote:
 I have frequently wanted to write utility code that processes an
 object in a particular way on both the client and server side
 representation of the object.

 Unfortunately, when usingRequestFactory, it is difficult to make this
 work cleanly.  You can declare that your domain object implements the
 proxy interface, and then write your common code in terms of the proxy
 interface.  But you will then have to come up with a dummy
 implementation of the stableId method required by EntityProxy.  If
 that doesn't bother you, then it should work.

 Ryan

 On Aug 4, 2:32 pm, br22 g22...@gmail.com wrote:

  Thank you, I have a Java code that can run either on the client or the
  server.
  When on the client it uses the Obj1Proxy that it gets from the server,
  but when it runs on the server it has the original Obj1. I assume that
  it can be solved with “generics” and “implements” , but I don't know
  Java that well.
  Thanks.

  On Aug 4, 1:52 pm, Ben Munge ben.mu...@gmail.com wrote:

   You generally shouldn't be doing this from a design standpoint. If you
   want to share some simple objects or utilities you could use the
   shared package, but beyond that would break encapsulation. If you
   could explain your requirements in a bit more detail I might be able
   to provide better assistance.

   On Aug 4, 11:24 am, br22 g22...@gmail.com wrote:

Great, but how you make the SAME Java code (that runs both on the
client and the server) share the SAME object (not 2 objects like Obj1
and Obj1Proxy)?

On Aug 4, 11:34 am, Ben Munge ben.mu...@gmail.com wrote:

 You create a Proxy object on the client for your corresponding server
 object.

http://code.google.com/webtoolkit/doc/latest/DevGuideRequestFactory.html

 On Aug 4, 5:46 am, br22 g22...@gmail.com wrote:

  Sometimes you want the same Java code to run on the client and 
  server.
  With RPC it is easy to share the same object, what is thebestway to
  do this with RF?
  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 google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



RequestFactory Best Practices: How to share object between client and server

2011-08-04 Thread br22
Sometimes you want the same Java code to run on the client and server.
With RPC it is easy to share the same object, what is the best way to
do this with RF?
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 google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: RequestFactory Best Practices: How to share object between client and server

2011-08-04 Thread Ben Munge
You create a Proxy object on the client for your corresponding server
object.

http://code.google.com/webtoolkit/doc/latest/DevGuideRequestFactory.html


On Aug 4, 5:46 am, br22 g22...@gmail.com wrote:
 Sometimes you want the same Java code to run on the client and server.
 With RPC it is easy to share the same object, what is the best way to
 do this with RF?
 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 google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: RequestFactory Best Practices: How to share object between client and server

2011-08-04 Thread br22
Great, but how you make the SAME Java code (that runs both on the
client and the server) share the SAME object (not 2 objects like Obj1
and Obj1Proxy)?

On Aug 4, 11:34 am, Ben Munge ben.mu...@gmail.com wrote:
 You create a Proxy object on the client for your corresponding server
 object.

 http://code.google.com/webtoolkit/doc/latest/DevGuideRequestFactory.html

 On Aug 4, 5:46 am, br22 g22...@gmail.com wrote:

  Sometimes you want the same Java code to run on the client and server.
  With RPC it is easy to share the same object, what is the best way to
  do this with RF?
  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 google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: RequestFactory Best Practices: How to share object between client and server

2011-08-04 Thread Ben Munge
You generally shouldn't be doing this from a design standpoint. If you
want to share some simple objects or utilities you could use the
shared package, but beyond that would break encapsulation. If you
could explain your requirements in a bit more detail I might be able
to provide better assistance.

On Aug 4, 11:24 am, br22 g22...@gmail.com wrote:
 Great, but how you make the SAME Java code (that runs both on the
 client and the server) share the SAME object (not 2 objects like Obj1
 and Obj1Proxy)?

 On Aug 4, 11:34 am, Ben Munge ben.mu...@gmail.com wrote:







  You create a Proxy object on the client for your corresponding server
  object.

 http://code.google.com/webtoolkit/doc/latest/DevGuideRequestFactory.html

  On Aug 4, 5:46 am, br22 g22...@gmail.com wrote:

   Sometimes you want the same Java code to run on the client and server.
   With RPC it is easy to share the same object, what is the best way to
   do this with RF?
   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 google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: RequestFactory Best Practices: How to share object between client and server

2011-08-04 Thread br22
Thank you, I have a Java code that can run either on the client or the
server.
When on the client it uses the Obj1Proxy that it gets from the server,
but when it runs on the server it has the original Obj1. I assume that
it can be solved with “generics” and “implements” , but I don't know
Java that well.
Thanks.

On Aug 4, 1:52 pm, Ben Munge ben.mu...@gmail.com wrote:
 You generally shouldn't be doing this from a design standpoint. If you
 want to share some simple objects or utilities you could use the
 shared package, but beyond that would break encapsulation. If you
 could explain your requirements in a bit more detail I might be able
 to provide better assistance.

 On Aug 4, 11:24 am, br22 g22...@gmail.com wrote:

  Great, but how you make the SAME Java code (that runs both on the
  client and the server) share the SAME object (not 2 objects like Obj1
  and Obj1Proxy)?

  On Aug 4, 11:34 am, Ben Munge ben.mu...@gmail.com wrote:

   You create a Proxy object on the client for your corresponding server
   object.

  http://code.google.com/webtoolkit/doc/latest/DevGuideRequestFactory.html

   On Aug 4, 5:46 am, br22 g22...@gmail.com wrote:

Sometimes you want the same Java code to run on the client and server.
With RPC it is easy to share the same object, what is the best way to
do this with RF?
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 google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: RequestFactory Best Practices: How to share object between client and server

2011-08-04 Thread Ryan McFall
I have frequently wanted to write utility code that processes an
object in a particular way on both the client and server side
representation of the object.

Unfortunately, when using RequestFactory, it is difficult to make this
work cleanly.  You can declare that your domain object implements the
proxy interface, and then write your common code in terms of the proxy
interface.  But you will then have to come up with a dummy
implementation of the stableId method required by EntityProxy.  If
that doesn't bother you, then it should work.

Ryan

On Aug 4, 2:32 pm, br22 g22...@gmail.com wrote:
 Thank you, I have a Java code that can run either on the client or the
 server.
 When on the client it uses the Obj1Proxy that it gets from the server,
 but when it runs on the server it has the original Obj1. I assume that
 it can be solved with “generics” and “implements” , but I don't know
 Java that well.
 Thanks.

 On Aug 4, 1:52 pm, Ben Munge ben.mu...@gmail.com wrote:







  You generally shouldn't be doing this from a design standpoint. If you
  want to share some simple objects or utilities you could use the
  shared package, but beyond that would break encapsulation. If you
  could explain your requirements in a bit more detail I might be able
  to provide better assistance.

  On Aug 4, 11:24 am, br22 g22...@gmail.com wrote:

   Great, but how you make the SAME Java code (that runs both on the
   client and the server) share the SAME object (not 2 objects like Obj1
   and Obj1Proxy)?

   On Aug 4, 11:34 am, Ben Munge ben.mu...@gmail.com wrote:

You create a Proxy object on the client for your corresponding server
object.

   http://code.google.com/webtoolkit/doc/latest/DevGuideRequestFactory.html

On Aug 4, 5:46 am, br22 g22...@gmail.com wrote:

 Sometimes you want the same Java code to run on the client and server.
 With RPC it is easy to share the same object, what is the best way to
 do this with RF?
 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 google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.