<?xml version="1.0" encoding="UTF-8"?><rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
> <channel><title>Comments on: Serializing (And Deserializing) Objects With Ruby</title> <atom:link href="http://www.skorks.com/2010/04/serializing-and-deserializing-objects-with-ruby/feed/" rel="self" type="application/rss+xml" /><link>http://www.skorks.com/2010/04/serializing-and-deserializing-objects-with-ruby/</link> <description>For the betterment of the software craft...</description> <lastBuildDate>Mon, 21 Nov 2011 13:57:06 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.1.2</generator> <item><title>By: Probando geoplugin.net desde ruby &#124; Javi Sanromán</title><link>http://www.skorks.com/2010/04/serializing-and-deserializing-objects-with-ruby/comment-page-1/#comment-7262</link> <dc:creator>Probando geoplugin.net desde ruby &#124; Javi Sanromán</dc:creator> <pubDate>Fri, 29 Jul 2011 11:24:24 +0000</pubDate> <guid
isPermaLink="false">http://www.skorks.com/?p=1693#comment-7262</guid> <description>[...] objeto serializado al modo php. Depués de probar la gema json y otros medios de serialización/deserialización de objetos ruby sin éxito, me encuentro con la gema php-serialize que hace justo lo que [...]</description> <content:encoded><![CDATA[<p>[...] objeto serializado al modo php. Depués de probar la gema json y otros medios de serialización/deserialización de objetos ruby sin éxito, me encuentro con la gema php-serialize que hace justo lo que [...]</p> ]]></content:encoded> </item> <item><title>By: links for 2011-04-23 &#171; Use You Imagination</title><link>http://www.skorks.com/2010/04/serializing-and-deserializing-objects-with-ruby/comment-page-1/#comment-7098</link> <dc:creator>links for 2011-04-23 &#171; Use You Imagination</dc:creator> <pubDate>Sat, 23 Apr 2011 15:01:57 +0000</pubDate> <guid
isPermaLink="false">http://www.skorks.com/?p=1693#comment-7098</guid> <description>[...] Serializing (And Deserializing) Objects With Ruby (tags: serialization ruby json binary yaml) [...]</description> <content:encoded><![CDATA[<p>[...] Serializing (And Deserializing) Objects With Ruby (tags: serialization ruby json binary yaml) [...]</p> ]]></content:encoded> </item> <item><title>By: Inside Ruby on Rails: Serializing Ruby objects with JSON &#8211; Simone Carletti&#39;s Blog</title><link>http://www.skorks.com/2010/04/serializing-and-deserializing-objects-with-ruby/comment-page-1/#comment-4887</link> <dc:creator>Inside Ruby on Rails: Serializing Ruby objects with JSON &#8211; Simone Carletti&#39;s Blog</dc:creator> <pubDate>Thu, 29 Apr 2010 09:35:18 +0000</pubDate> <guid
isPermaLink="false">http://www.skorks.com/?p=1693#comment-4887</guid> <description>[...] few weeks ago, Alan Snorkin posted a nice article about serializing objects with Ruby introducing different serialization options, including YAML, Marshaling and JSON. This reminded me [...]</description> <content:encoded><![CDATA[<p>[...] few weeks ago, Alan Snorkin posted a nice article about serializing objects with Ruby introducing different serialization options, including YAML, Marshaling and JSON. This reminded me [...]</p> ]]></content:encoded> </item> <item><title>By: ac</title><link>http://www.skorks.com/2010/04/serializing-and-deserializing-objects-with-ruby/comment-page-1/#comment-4795</link> <dc:creator>ac</dc:creator> <pubDate>Fri, 23 Apr 2010 09:14:33 +0000</pubDate> <guid
isPermaLink="false">http://www.skorks.com/?p=1693#comment-4795</guid> <description>i&#039;ve also had problems with yaml and whitespaces.. for example
YAML::load(&quot;\n&quot;.to_yaml)  # =&gt; &quot;&quot;
for that reason i went with json, only to discover that can&#039;t handle binary payload in strings, so i ended up stripping out all strings to a separate data block and replace them with their index in the data block and length.
(i wanted to also use it with other languages, so marshal wasn&#039;t an option)</description> <content:encoded><![CDATA[<p>i&#8217;ve also had problems with yaml and whitespaces.. for example</p><p>YAML::load(&#8220;\n&#8221;.to_yaml)  # =&gt; &#8220;&#8221;</p><p>for that reason i went with json, only to discover that can&#8217;t handle binary payload in strings, so i ended up stripping out all strings to a separate data block and replace them with their index in the data block and length.</p><p>(i wanted to also use it with other languages, so marshal wasn&#8217;t an option)</p> ]]></content:encoded> </item> <item><title>By: Tomasz Bak</title><link>http://www.skorks.com/2010/04/serializing-and-deserializing-objects-with-ruby/comment-page-1/#comment-4668</link> <dc:creator>Tomasz Bak</dc:creator> <pubDate>Fri, 16 Apr 2010 22:12:37 +0000</pubDate> <guid
isPermaLink="false">http://www.skorks.com/?p=1693#comment-4668</guid> <description>I used YAML for serializing both reports tempaltes and reports data. The structures were not very complicated, the business case was to have flexibility over defining defects reports in a manufacturing process.
I have experienced occasionally corupted YAML in reports data, which sometimes was hundreds of YAML serialized objects stored in single database text filed (PostgreSQL).</description> <content:encoded><![CDATA[<p>I used YAML for serializing both reports tempaltes and reports data. The structures were not very complicated, the business case was to have flexibility over defining defects reports in a manufacturing process.</p><p>I have experienced occasionally corupted YAML in reports data, which sometimes was hundreds of YAML serialized objects stored in single database text filed (PostgreSQL).</p> ]]></content:encoded> </item> <item><title>By: LucaB</title><link>http://www.skorks.com/2010/04/serializing-and-deserializing-objects-with-ruby/comment-page-1/#comment-4660</link> <dc:creator>LucaB</dc:creator> <pubDate>Fri, 16 Apr 2010 08:55:26 +0000</pubDate> <guid
isPermaLink="false">http://www.skorks.com/?p=1693#comment-4660</guid> <description>I really enjoyed the post, very useful, as its comments are.
In my recent experience, serialization is fundamental to skip accessing the database during the creation of objects related the current one.
The de-serialization phase is also smooth, I don&#039;t even need to explicitly refer to an array.
For example:
MyClass.write_associated_objects_to_yaml_file (method which access to the database, and use to_yaml) gives me a yaml which already represents an array.
When I do MyClass.read_associated_objects_from_yaml_file, I automatically get an array filled with objects of the right type (MyOtherClass), using &quot;YAML.load_file &#039;my_yaml.yml&#039;&quot;.
I only have to be careful and do
load &#039;my_other_class.rb&#039;
otherwise I get a bunch of &quot;YAML::Object&quot;s, which are not that useful... :-)
Thanks, this is a very interesting argument,
LucaB</description> <content:encoded><![CDATA[<p>I really enjoyed the post, very useful, as its comments are.<br
/> In my recent experience, serialization is fundamental to skip accessing the database during the creation of objects related the current one.<br
/> The de-serialization phase is also smooth, I don&#8217;t even need to explicitly refer to an array.<br
/> For example:</p><p>MyClass.write_associated_objects_to_yaml_file (method which access to the database, and use to_yaml) gives me a yaml which already represents an array.</p><p>When I do MyClass.read_associated_objects_from_yaml_file, I automatically get an array filled with objects of the right type (MyOtherClass), using &#8220;YAML.load_file &#8216;my_yaml.yml&#8217;&#8221;.</p><p>I only have to be careful and do<br
/> load &#8216;my_other_class.rb&#8217;<br
/> otherwise I get a bunch of &#8220;YAML::Object&#8221;s, which are not that useful&#8230; :-)</p><p>Thanks, this is a very interesting argument,<br
/> LucaB</p> ]]></content:encoded> </item> <item><title>By: Marc-Andre Lafortune</title><link>http://www.skorks.com/2010/04/serializing-and-deserializing-objects-with-ruby/comment-page-1/#comment-4656</link> <dc:creator>Marc-Andre Lafortune</dc:creator> <pubDate>Fri, 16 Apr 2010 04:04:06 +0000</pubDate> <guid
isPermaLink="false">http://www.skorks.com/?p=1693#comment-4656</guid> <description>Marshal provides for mechanism to be backward compatible should you change your data format and need it: just specialize marshal_load and marshal_dump.</description> <content:encoded><![CDATA[<p>Marshal provides for mechanism to be backward compatible should you change your data format and need it: just specialize marshal_load and marshal_dump.</p> ]]></content:encoded> </item> <item><title>By: Marc-Andre Lafortune</title><link>http://www.skorks.com/2010/04/serializing-and-deserializing-objects-with-ruby/comment-page-1/#comment-4655</link> <dc:creator>Marc-Andre Lafortune</dc:creator> <pubDate>Fri, 16 Apr 2010 04:01:57 +0000</pubDate> <guid
isPermaLink="false">http://www.skorks.com/?p=1693#comment-4655</guid> <description>I believe you are mistaken.
First, all implementations of Ruby are mandated to respect the Marshal binary format for a given marshal version. Check RubySpec (core/marshal)
Second, marshal version has changed between 1.8 and 1.9, but it is backward compatible and mostly forward compatible.</description> <content:encoded><![CDATA[<p>I believe you are mistaken.<br
/> First, all implementations of Ruby are mandated to respect the Marshal binary format for a given marshal version. Check RubySpec (core/marshal)<br
/> Second, marshal version has changed between 1.8 and 1.9, but it is backward compatible and mostly forward compatible.</p> ]]></content:encoded> </item> <item><title>By: Korny</title><link>http://www.skorks.com/2010/04/serializing-and-deserializing-objects-with-ruby/comment-page-1/#comment-4651</link> <dc:creator>Korny</dc:creator> <pubDate>Fri, 16 Apr 2010 03:21:57 +0000</pubDate> <guid
isPermaLink="false">http://www.skorks.com/?p=1693#comment-4651</guid> <description>Yeah - that&#039;s why I always prefer something like JSON or YAML - not only are the others implementation dependent, they are my-code-version dependent.
I guess it depends *why* you are serializing data - if it&#039;s only temporary, it&#039;s handy to use Marshal or whatever is fastest.  But if it&#039;s not ephemeral data, it&#039;s nice to have a generic format I can de-serialise at any time in the future, even if I&#039;ve changed my object model in the meantime.</description> <content:encoded><![CDATA[<p>Yeah &#8211; that&#8217;s why I always prefer something like JSON or YAML &#8211; not only are the others implementation dependent, they are my-code-version dependent.<br
/> I guess it depends *why* you are serializing data &#8211; if it&#8217;s only temporary, it&#8217;s handy to use Marshal or whatever is fastest.  But if it&#8217;s not ephemeral data, it&#8217;s nice to have a generic format I can de-serialise at any time in the future, even if I&#8217;ve changed my object model in the meantime.</p> ]]></content:encoded> </item> <item><title>By: Delano Mandelbaum</title><link>http://www.skorks.com/2010/04/serializing-and-deserializing-objects-with-ruby/comment-page-1/#comment-4645</link> <dc:creator>Delano Mandelbaum</dc:creator> <pubDate>Thu, 15 Apr 2010 18:19:50 +0000</pubDate> <guid
isPermaLink="false">http://www.skorks.com/?p=1693#comment-4645</guid> <description>That&#039;s true. The other issue with Marshal (and other binary formats) is that you can&#039;t (safely) marshal between versions or implementations of Ruby (e.g. 1.8 to 1.9 or MRI to JRuby).</description> <content:encoded><![CDATA[<p>That&#8217;s true. The other issue with Marshal (and other binary formats) is that you can&#8217;t (safely) marshal between versions or implementations of Ruby (e.g. 1.8 to 1.9 or MRI to JRuby).</p> ]]></content:encoded> </item> </channel> </rss>
