Serialization
 
Home My Account Forum Try It! Buy It!
About Contact Us Site Map
StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



SerializationExpand / Collapse
Author
Message
Posted 11/29/2005 3:48:53 PM
StrataFrame Beginner

StrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame Beginner

Group: Forum Members
Last Login: 03/25/2006 6:08:39 PM
Posts: 36, Visits: 65
Our application requires that fields in the database, represented by the business object, be serialized remotely.

Could someone explain the process or point me to a link that explains how this process is done in your framework?

1. Do you have an option where the  serialized data is  stored?

2. Can it be hooked into the .net remoting?

3. How do you select what is serialized? I thought it was done after the object is dropped on the form?

Post #182
Posted 11/29/2005 8:33:20 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Today @ 11:13:06 AM
Posts: 4,104, Visits: 4,176
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.

Serialize the Business Object
Private Sub SerializeMethod()
'-- Establish Locals
Dim loFile As New System.IO.FileStream("c:\serializedBO.bin", System.IO.FileMode.Create)
Dim loCustomers As New CustomersBO()


'-- Load some data into the business object
loCustomers.FillAll()


'-- Serialize the business object to the stream
loCustomers.SerializeToStream(loFile)


'-- Close the stream
loFile.Close()


'-- Close the BO
loCustomers.Dispose()
End Sub


De-serialize the Business Object
Private Sub DeserializeMethod()
'-- Establish Lcoals
Dim loFile As New System.IO.FileStream("c:\serializedBO.bin", System.IO.FileMode.Open)
Dim loCustomers As CustomersBO


'-- Deserialize the saved business object from a stream
loCustomers = CustomersBO.DeserializeBusinessObject(loFile)


'-- Close the stream
loFile.Close()
End Sub
Post #189
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 6:01pm

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.109. 9 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.