Re: using new 2.1.1rc RequestFactory AutoBean in RESTful Architecture
very valid questions. A good number of gwt developers at some stage will face similar questions. I would appreciate if someone could share their experiences and findings pertaining to the questions zixzigma has brought up. -- 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: using new 2.1.1rc RequestFactory AutoBean in RESTful Architecture
On Saturday, December 11, 2010 2:01:28 PM UTC-8, zixzigma wrote: is it possible to use 2.1.1 RequestFactory/AutoBean to convert POJO to JSON and viceversa when interacting with a RESTful Web Service ? the common practice with GWT client-server communication is to have packages: client, shared, server, configuring web.xml however, in-order to be truly loosely coupled, I am thinking of developing the Server side of my app, as a REST WebService. completely separate from the client. sending JSON encoded data to the Server, and reading JSON. only using a common .jar file on both containing Entity POJOs. the problem on GWT client side is a clean way of Converting JSON to POJO back and forth. I was wondering if the new AutoBean/RequestFactory/EntityProxy can help in the situation I described ? Clean conversion of JSON is achieved with com.google.gwt.jsonp.client.JsonpRequestBuilder Request factory is not necessary. These guidelines describe the basics of working with JSON and overlay types (JavaScript objects wrapped with Java facade) http://code.google.com/webtoolkit/doc/latest/tutorial/JSON.html com.google.gwt.jsonp.client.JsonpRequestBuilder simplifies things even more because there is no need to do any JSNI and eval(). And it also allows for cross-site communication variant called JSON with padding, which is described in detail here: http://code.google.com/webtoolkit/doc/latest/tutorial/Xsite.html Can i still use Editor if I opt for JSON/REST solution above ? What do you think of this approach ? do you think it may result in performance problems ? Since overlay types look like POJOs, I think they should work with Editor framework, but I haven't tried that. -- 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: using new 2.1.1rc RequestFactory AutoBean in RESTful Architecture
Also, you may want to have a look at https://github.com/chirino/resty-gwt. It automates JSON--POJO mapping to REST-style services using a GWT generator. AutoBeans could certainly be used for JSON--POJO mapping, as RequestFactory uses both AutoBeans and JSON under the covers. However, the RequestFactory wire protocol is its own thing built on top of JSON, so it's not quite a direct POJO-JSON conversion in the sense you're thinking about. Better to pick RequestFactory or REST rather than try to marry them, I think, as REST and RPC of any kind are fundamentally different ways of thinking about remote services. Editors are orthogonal to RequestFactory. Have a look at the SimpleBeanEditorDriver in 2.1 for use with your POJOs. /dmc On Sat, Jan 15, 2011 at 3:37 PM, Y2i yur...@gmail.com wrote: On Saturday, December 11, 2010 2:01:28 PM UTC-8, zixzigma wrote: is it possible to use 2.1.1 RequestFactory/AutoBean to convert POJO to JSON and viceversa when interacting with a RESTful Web Service ? the common practice with GWT client-server communication is to have packages: client, shared, server, configuring web.xml however, in-order to be truly loosely coupled, I am thinking of developing the Server side of my app, as a REST WebService. completely separate from the client. sending JSON encoded data to the Server, and reading JSON. only using a common .jar file on both containing Entity POJOs. the problem on GWT client side is a clean way of Converting JSON to POJO back and forth. I was wondering if the new AutoBean/RequestFactory/EntityProxy can help in the situation I described ? Clean conversion of JSON is achieved with com.google.gwt.jsonp.client.JsonpRequestBuilder Request factory is not necessary. These guidelines describe the basics of working with JSON and overlay types (JavaScript objects wrapped with Java facade) http://code.google.com/webtoolkit/doc/latest/tutorial/JSON.html com.google.gwt.jsonp.client.JsonpRequestBuilder simplifies things even more because there is no need to do any JSNI and eval(). And it also allows for cross-site communication variant called JSON with padding, which is described in detail here: http://code.google.com/webtoolkit/doc/latest/tutorial/Xsite.html Can i still use Editor if I opt for JSON/REST solution above ? What do you think of this approach ? do you think it may result in performance problems ? Since overlay types look like POJOs, I think they should work with Editor framework, but I haven't tried that. -- 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.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. -- David Chandler Developer Programs Engineer, Google Web Toolkit w: http://code.google.com/ b: http://googlewebtoolkit.blogspot.com/ t: @googledevtools -- 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.
using new 2.1.1rc RequestFactory AutoBean in RESTful Architecture
is it possible to use 2.1.1 RequestFactory/AutoBean to convert POJO to JSON and viceversa when interacting with a RESTful Web Service ? the common practice with GWT client-server communication is to have packages: client, shared, server, configuring web.xml however, in-order to be truly loosely coupled, I am thinking of developing the Server side of my app, as a REST WebService. completely separate from the client. sending JSON encoded data to the Server, and reading JSON. only using a common .jar file on both containing Entity POJOs. the problem on GWT client side is a clean way of Converting JSON to POJO back and forth. I was wondering if the new AutoBean/RequestFactory/EntityProxy can help in the situation I described ? Can i still use Editor if I opt for JSON/REST solution above ? What do you think of this approach ? do you think it may result in performance problems ? I am going to write both the client and servers in Java, and have access to the code. but my main concern is clean separation, complete isolation and loose coupling. I would like to know what are the down-sides to this, and if the new 2.1.1 features can help ? these Architectural decisions are about tradeoff, I would like to know what I am going to lose if I chose the approach I described above. 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-tool...@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.