From: Stefan F. <ste...@we...> - 2012-06-08 13:07:28
|
Erik: first of all it could help to solve the problem you describe below. Currently the xml encoding and the rails classes are far from being a one:to:one relationship. Even if there is good reason to have that, it would be easier to support, test and code if the xml gets first read into a java object that closely resembles that structure and then translate that into the object that is used later on inside Rails. Example: You would first create a CompanyDefinition object which is very close the XML and then this is converted into the true Rails Company object. This would allow disconnect the creation of a Rails company from the xml code an thus make it easier to create a company by code directly for testing. And your question what does including a new technology helps us solving is always a relevant one, there is nothing backwards with that approach. Stefan On 06/06/2012 10:47 PM, Erik Vos wrote: > What problems would this solve? > > For initialization: it would be nice if XML data and objects were anywhere > near have a to 1:1 relationship, but in many cases that is far from being > the case. > So I suppose this would cause much rework. > > For communication: I would tend to consider XML too verbose for such a > purpose. It's not for nothing that (I believe) Google has invented a more > compact format. > And for all I know XML parsing and creation is slooow, but perhaps that is > due to the old libraries we now use? > Indeed we need something, but I can't provide much insight. > I had in mind something like uuencoded Serialized objects (the Java way), > but I suppose that is way too primitive for these days. > And of course it would be a big benefit if the transmission is readable. > > Anyway, don't be put off by my (as usual) somewhat sceptical attitude. I'm > way backwards in most of these matters. > > Erik > >> -----Original Message----- >> From: brett lentz [mailto:bre...@gm...] >> Sent: Wednesday, June 06, 2012 7:05 PM >> To: Development list for Rails: an 18xx game >> Subject: Re: [Rails-devel] Another library to add? >> >> On Wed, Jun 6, 2012 at 12:55 PM, Stefan Frey<ste...@we...> wrote: >>> Brett& Erik, >>> going forward I am considering refactoring the xml initialization of >>> Rails. Further I did a short comparison of the feature and syntax of a >>> few xml serialization libraries for java and very quickly found one >>> that pleases me. >>> >>> The idea of the newer libraries add is that it is possible to align >>> the java classes and xml elements, so that in effect you do not have >>> to write anymore manually for parsing. Most of them use annotations to >>> control this mechanism. >>> >> >> +1 from me. Annotation/Decorators are a fantastic way to handle this. >> Also, the removal of manual parsing code is a huge win, IMO. >> >>> So my proposal is to use Simple Serialization Library (see >>> http://simple.sourceforge.net/home.php) >>> >>> Checkout >>> http://simple.sourceforge.net/download/stream/doc/tutorial/tutorial.ph >>> p >>> for documentation and code examples). >>> >>> (Reasonable Alternatives were XStream and Jackson with XML extension >>> and Protostuff, I do not like JAXB) >>> >>> I am still considering to choose a more compact format (like Json or >>> even a binary one like Kryo or Smile) for the planned network play. >> >> Given the choice, I'd opt for JSON or YAML over binary formats. >> They're well-known, well-supported, and (most importantly) easier to >> debug. >> >> Over the wire, we can use compression to slim down the bandwidth >> requirements of transmitting plain-text data. >> >>> >>> Stefan >>> >> >> ---Brett. >> >> > ---------------------------------------------------------------------------- > -- >> Live Security Virtual Conference >> Exclusive live event will cover all the ways today's security and threat >> landscape has changed and how IT managers can respond. Discussions will >> include endpoint security, mobile security and the latest in malware > threats. >> http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >> _______________________________________________ >> Rails-devel mailing list >> Rai...@li... >> https://lists.sourceforge.net/lists/listinfo/rails-devel > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel |