Please advise me a simple serialization package to wrap Strings, Integers, Arrays and Hashtables into a character stream. I need to exchange data between Java applet and Rails app and I want to do it as simple as it can be. Gábor
You could give a try to JSON http://www.crockford.com/JSON/. The Ruby parser is only a single line of code ! Julien -----Original Message----- From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Gábor SEBESTYÉN Sent: Tuesday, May 03, 2005 10:17 AM To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: [Rails] simple serialization package Please advise me a simple serialization package to wrap Strings, Integers, Arrays and Hashtables into a character stream. I need to exchange data between Java applet and Rails app and I want to do it as simple as it can be. Gábor _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
On 2005.05.03., at 10:24, Faissolle, Julien wrote:> You could give a try to JSON http://www.crockford.com/JSON/. The > Ruby parser is only a single line of code ! >Thanks!! It seems very usable from my point of view :) That''s all I need! :) Gábor _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Another approach would be to define a schema for your interchange format and use JAXB on the Java side, and some Schema->Ruby binding tool on Ruby''s side. I''ve used the same approach for Java->.Net interop. Way over the top for this though :-) Anyone fancy porting XStream to Ruby? :-) sam On 5/3/05, Gábor SEBESTYÉN <segabor-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > On 2005.05.03., at 10:24, Faissolle, Julien wrote: > > > You could give a try to JSON http://www.crockford.com/JSON/. The Ruby parser > is only a single line of code ! > > Thanks!! It seems very usable from my point of view :) That''s all I need! :) > Gábor > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-- sam http://www.magpiebrain.com/
There''s a Ruby-JSON lib (http://sourceforge.net/projects/json) that works well. It has a real Lexer for property JSON evaling. The interface is really awkward though. What about YAML? It''s heavily used in Rails already. It just doesn''t get any clearer than the YAML.rb page: http://yaml4r.sourceforge.net/ ("Armless birds basically falling everywhere"). On 5/3/05, Gábor SEBESTYÉN <segabor-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > On 2005.05.03., at 10:24, Faissolle, Julien wrote: > > > You could give a try to JSON http://www.crockford.com/JSON/. The Ruby parser > is only a single line of code ! > > Thanks!! It seems very usable from my point of view :) That''s all I need! :) > Gábor > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-- rick http://techno-weenie.net
You can do RPC in JSON with JSON-RPC (http://json-rpc.org/impl.xhtml). There are implementations in Ruby and Java. -----Original Message----- From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Sam Newman Sent: Tuesday, May 03, 2005 5:40 PM To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: Re: [Rails] simple serialization package Another approach would be to define a schema for your interchange format and use JAXB on the Java side, and some Schema->Ruby binding tool on Ruby''s side. I''ve used the same approach for Java->.Net interop. Way over the top for this though :-) Anyone fancy porting XStream to Ruby? :-) sam On 5/3/05, Gábor SEBESTYÉN <segabor-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > On 2005.05.03., at 10:24, Faissolle, Julien wrote: > > > You could give a try to JSON http://www.crockford.com/JSON/. The Ruby > parser is only a single line of code ! > > Thanks!! It seems very usable from my point of view :) That''s all I > need! :) Gábor > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-- sam http://www.magpiebrain.com/ _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
If you go with YAML, there is at least one Java YAML parser out there - try the one at http://homepages.ihug.com.au/~zenaan/zenaan/files/yamljava/ which I believe supercedes the one at http://helide.com/g/yaml/ (those people moved on to an OGDL parser - http://ogdl.sourceforge.net/ - I don''t know if there is a ruby parser for that. Too Many Markup Languages....) On 5/3/05, Rick Olson <technoweenie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> There''s a Ruby-JSON lib (http://sourceforge.net/projects/json) that > works well. It has a real Lexer for property JSON evaling. The > interface is really awkward though. > > What about YAML? It''s heavily used in Rails already. It just doesn''t > get any clearer than the YAML.rb page: http://yaml4r.sourceforge.net/ > ("Armless birds basically falling everywhere"). >sam http://www.magpiebrain.com/