Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / December 2004

Tip: Looking for answers? Try searching our database.

Object serialization.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
AVL - 07 Dec 2004 07:25 GMT
Hi,
   I'm new to .net. I need some info on serialization.

What is serialization? Why do we need it? Why objects need to be serialized
if they need to be stored in session or viewstate?
Joyjit Mukherjee - 07 Dec 2004 08:51 GMT
Hi,

Serialization is the process of transforming an object into a stream for
transmission so that they can be recreated later.

We need serialization because we need to pass objects across application
domains or tiers to recreate it there along with the object's state
information.

Objects stored in Session or ViewState needs to be serialized because we
want to the object to persist its state across postbacks, and HTTP is a
stateless protocol, so...

For more insight, see this article in MSDN
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/o
bjserializ.asp


Let me know if you need anything else.

Thanks
Joyjit

> Hi,
>     I'm new to .net. I need some info on serialization.
>
> What is serialization? Why do we need it? Why objects need to be serialized
> if they need to be stored in session or viewstate?
Keith Patrick - 07 Dec 2004 16:45 GMT
Serialization is necessary in viewstate (albeit it looks encrypted) because
HTML can only show text, not a binary object.  It could conceivably use a
binary description of an object encoded to text, but that encoding is yet
another protocol, so XML is easier from a decision-making standpoint.
I'll give you another example of using serialization, as I really don't mess
with the viewstate and dont' care about the format of my session vars: I
work on an app that displays grids of data for reports but also displays
complex hierarchies of relationships.  For the former, I just use automatic
databinding, and that's that, as tables are perfectly suited for that kind
of data.  However, for the hierarchical data, my intent is to pull various
related records into a hierarchical structure (my object).  However, SQL
Server doesn't return CLR objects, so the DB and my app communicate with
text.  Because of that, when the app gets the data, it can either get a
bunch of DB records and build an object from that, but that is tying DB
schema into the app.  Instead, I just have the DB query return the data in
XML (in other words, as a serialized object).  All my code has to do to
access that object now is to merely deserialize it.

> Hi,
>    I'm new to .net. I need some info on serialization.
>
> What is serialization? Why do we need it? Why objects need to be
> serialized
> if they need to be stored in session or viewstate?

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.