﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum / StrataFrame Application Framework / Business Objects and Data Access (How do I?)  / Serialization / Latest Posts</title><generator>InstantForum.NET v4.1.4</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>forum@strataframe.net</webMaster><lastBuildDate>Thu, 21 Aug 2008 20:00:06 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Serialization</title><link>http://forum.strataframe.net/Topic182-6-1.aspx</link><description>There are two serialization methods on a business object: SerializeToStream and SerialzieToByteArray. These work just as the names state. SerializeToStream supports any stream type such as a network stream, file stream, memory stream, etc. Here is a sample of serializing a business object and then de-serializing it. I am using a file stream here for sample purposes, but you could just as easily use a network stream which could be remoted or allow you to create a server that hands out business objects. The possibilities are limitless.&lt;br&gt;&lt;br&gt;&lt;STRONG&gt;Serialize the Business Object&lt;/STRONG&gt;&lt;br&gt;&lt;EM&gt;Private Sub SerializeMethod()&lt;br&gt; '-- Establish Locals&lt;br&gt; Dim loFile As New System.IO.FileStream("c:\serializedBO.bin", System.IO.FileMode.Create)&lt;br&gt; Dim loCustomers As New CustomersBO()&lt;/EM&gt;&lt;br&gt;&lt;br&gt;&lt;EM&gt; '-- Load some data into the business object&lt;br&gt; loCustomers.FillAll()&lt;/EM&gt;&lt;br&gt;&lt;br&gt;&lt;EM&gt; '-- Serialize the business object to the stream&lt;br&gt; loCustomers.SerializeToStream(loFile)&lt;/EM&gt;&lt;br&gt;&lt;br&gt;&lt;EM&gt; '-- Close the stream&lt;br&gt; loFile.Close()&lt;/EM&gt;&lt;br&gt;&lt;br&gt;&lt;EM&gt; '-- Close the BO&lt;br&gt; loCustomers.Dispose()&lt;br&gt; End Sub&lt;/EM&gt;&lt;br&gt;&lt;br&gt;&lt;STRONG&gt;De-serialize the Business Object&lt;/STRONG&gt;&lt;br&gt; &lt;EM&gt;Private Sub DeserializeMethod()&lt;br&gt; '-- Establish Lcoals&lt;br&gt; Dim loFile As New System.IO.FileStream("c:\serializedBO.bin", System.IO.FileMode.Open)&lt;br&gt; Dim loCustomers As CustomersBO&lt;/EM&gt;&lt;br&gt;&lt;br&gt;&lt;EM&gt; '-- Deserialize the saved business object from a stream&lt;br&gt; loCustomers = CustomersBO.DeserializeBusinessObject(loFile)&lt;/EM&gt;&lt;br&gt;&lt;br&gt;&lt;EM&gt; '-- Close the stream&lt;br&gt; loFile.Close()&lt;br&gt; End Sub&lt;/EM&gt;</description><pubDate>Tue, 29 Nov 2005 20:33:20 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>Serialization</title><link>http://forum.strataframe.net/Topic182-6-1.aspx</link><description>Our application requires that fields in the database, represented by the business object, be serialized remotely.&lt;/P&gt;&lt;P&gt;Could someone explain the process or point me to a link that explains how this process is done in your framework?&lt;/P&gt;&lt;P&gt;1. Do you have an option where the  serialized data is  stored?&lt;/P&gt;&lt;P&gt;2. Can it be hooked into the .net remoting?&lt;/P&gt;&lt;P&gt;3. How do you select what is serialized? I thought it was done after the object is dropped on the form?</description><pubDate>Tue, 29 Nov 2005 15:48:53 GMT</pubDate><dc:creator>John Frankewicz</dc:creator></item></channel></rss>