StrataFrame Forum

When To/Not To User

http://forum.strataframe.net/Topic11466.aspx

By choyt - 9/14/2007

Hi Folks

All of the SF classes created use the <Serializable()> attribute. At Microfour, do you have any general rules on when you make a non-business object class Serializable or not?

Thanks!

Clay

By Trent L. Taylor - 9/14/2007

The only time that we make a class serializable is when we plan to serialize the class through a Serialization formatter of some type and store the serialized object on disk, pass it over a remoting session or network stream, etc. and want the entire object intact when it gets to the other side.  Also, another time to use serialization is when you want to save the state of an object then retrieve that object from a file or database so that it skips all of the loading and instantiation upstart costs.  I don't know if that is very clear or not, but we use serialization very judiciously because there is overhead when passing around a serialized object.  So if you do no have the nee dto serialize the object then the attribute is not really necessary.  Hope that makes sense Smile  I was answering about 5 questions as I wrote this post BigGrin