| | | 
Advanced StrataFrame User
       
Group: StrataFrame Users Last Login: Today @ 6:17:55 AM Posts: 622, Visits: 19,163 |
| I hadn't fully wrapped my brain around it when I attended the training. Now I have and I LOVE it. I have serialized the contents of my custom classes, listbox contents, and BO's, mostly to XML for transport to other processes or applications. If your just coming into .NET like I was, get to know serialization, you wont regret it.
Mosty as a way to learn, I have written my own (De)SerializeToXML() classes. Now that I understand it, I have no issue with shortcuts. Does a SerializeToXML method for BO's exist in the framework?
Thanks. |
| | | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: Yesterday @ 10:38:53 PM Posts: 2,683, Visits: 1,883 |
| | The basic serialization methods on the BusinessLayer class use the BinaryFormatter instead of an XML formatter. However, you can serialize just the data within the business object by accessing the DataTable.WriteXml() method on the CurrentDataTable property like this: MyBO.CurrentDataTable.WriteXml(parameters...)
www.bungie.net |
| | | | 
Advanced StrataFrame User
       
Group: StrataFrame Users Last Login: 2 days ago @ 2:02:58 PM Posts: 644, Visits: 10,954 |
| | I'm really jealous right now. |
| | | | 
Advanced StrataFrame User
       
Group: StrataFrame Users Last Login: Today @ 6:17:55 AM Posts: 622, Visits: 19,163 |
| Ivan George Borges (09/12/2006) I'm really jealous right now.
Ben makes me jealous too.... someday I'll be there.
<< starts to sing poorly >>
If I could be like Ben...... |
| | | | 
Advanced StrataFrame User
       
Group: StrataFrame Users Last Login: 2 days ago @ 2:02:58 PM Posts: 644, Visits: 10,954 |
| Keith Chisarik (09/12/2006)
Ben makes me jealous too.... someday I'll be there.
Well, I'm not sure I will get to Ben's current level ... but if I do, I'm sure he will be already reading the binary code directly or something ... Tried the serialization, think I got the idea. So, as an example, I had a field declared as System.Drawing.Bitmap in my table, to store a picture. So, that's why I had to tell the Business Object Mapper to "serialize" it, which means, convert the Object into a binary that could be saved into the sql binary field? Then, this is what the BO Mapper is doing, letting me work with the field as a bitmap Object? And when it does it, it DEserialize it ? |
| | | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: Yesterday @ 10:38:53 PM Posts: 2,683, Visits: 1,883 |
| Yep, Ivan. A property is just a combination of two methods... one to "get" the value and one to "set" the value... So, when you get the value, the "get" method takes the binary data stored within the field and deserializes it (reconstructs the Bitmap object) and hands you the object as a System.Drawing.Bitmap. When you set the value, the "set" method then takes the Bitmap object you passed and serializes it (create a binary stream from the object data) and stores that binary data in the binary field in the business object.
www.bungie.net |
| | | | 
Advanced StrataFrame User
       
Group: StrataFrame Users Last Login: 2 days ago @ 2:02:58 PM Posts: 644, Visits: 10,954 |
| | | | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: Yesterday @ 10:38:53 PM Posts: 2,683, Visits: 1,883 |
| | |
|
|