| | | StrataFrame 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? |
| | | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: Yesterday @ 4:58:13 AM Posts: 4,379, Visits: 4,421 |
| 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 |
| |
|
|