does a web developer need to worry about serialization?

D

Dica

i understand the concept of serialization of objects, but do i really need
to worry about this as a web developer? i tend to pass my BED (business
entity definition) objects between pages by storing in session as in:

oUser.firstName = 'whatever';
oUser.lastName = 'whatever_last';
Session["oUser"] = oUser;
Response.Redirect 'nextPage.aspx';

at the end of my web apps life, any data i really needed to persist would be
saved to sql server. is there any reason i should consider serializing
things instead of following my normal course? i'm getting ready to take my
MCTS exam shortly and would like to incorporate everything i've learned into
my day to day application development, but don't see a practical application
for serialization.
 
G

George Ter-Saakov

I am not sure what you saying.

allow me to quote you...
"any data I really needed to persist would be saved to sql server."

Is not it a Serialization?
Very often in your applications you need to deal with objects that needs to
be saved completely.
Like config object for example. So Microsoft came up with easy way to do it
with XmlSerizalizer.
But nothing can stop you to write your own sterilizer that would save only
data you need.


George.
 
A

Aidy

Your objects need to be serialisable if you are storing the session in SQL
Server (not in memory which is default), if you store the object in the
ViewState, or if you send the object via a webservice. Maybe even remoting
if you use http as transport. If you are doing none of the above you don't
need to worry about it.
 
D

Dica

George Ter-Saakov said:
I am not sure what you saying.

allow me to quote you...
"any data I really needed to persist would be saved to sql server."

yes, i should have clarified what i meant by that better. i wouldn't save
the state of the object to sql server, but just the values of the object's
members. for instance:
sSql = "insert into users(firstName, lastName) values ('" + oUser.firstName
+ "', '" + oUser.lastName + "')";

i'll then have an overloaded method to recreate the oUsers object and pass
in the userID, run a sql statement to grab the values for that particular
user, and re-populate the object's members that way. but perhaps i could
learn to save the serialized object to sql server directly and recreate the
object more effeciently that way.

tks for the reply.
Is not it a Serialization?
Very often in your applications you need to deal with objects that needs
to be saved completely.
Like config object for example. So Microsoft came up with easy way to do
it with XmlSerizalizer.
But nothing can stop you to write your own sterilizer that would save only
data you need.


George.




Dica said:
i understand the concept of serialization of objects, but do i really need
to worry about this as a web developer? i tend to pass my BED (business
entity definition) objects between pages by storing in session as in:

oUser.firstName = 'whatever';
oUser.lastName = 'whatever_last';
Session["oUser"] = oUser;
Response.Redirect 'nextPage.aspx';

at the end of my web apps life, any data i really needed to persist would
be saved to sql server. is there any reason i should consider serializing
things instead of following my normal course? i'm getting ready to take
my MCTS exam shortly and would like to incorporate everything i've
learned into my day to day application development, but don't see a
practical application for serialization.
 
S

sloan

Then look at my other entry:
http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!140.entry




Dica said:
George Ter-Saakov said:
I am not sure what you saying.

allow me to quote you...
"any data I really needed to persist would be saved to sql server."

yes, i should have clarified what i meant by that better. i wouldn't save
the state of the object to sql server, but just the values of the object's
members. for instance:
sSql = "insert into users(firstName, lastName) values ('" + oUser.firstName
+ "', '" + oUser.lastName + "')";

i'll then have an overloaded method to recreate the oUsers object and pass
in the userID, run a sql statement to grab the values for that particular
user, and re-populate the object's members that way. but perhaps i could
learn to save the serialized object to sql server directly and recreate the
object more effeciently that way.

tks for the reply.
Is not it a Serialization?
Very often in your applications you need to deal with objects that needs
to be saved completely.
Like config object for example. So Microsoft came up with easy way to do
it with XmlSerizalizer.
But nothing can stop you to write your own sterilizer that would save only
data you need.


George.




Dica said:
i understand the concept of serialization of objects, but do i really need
to worry about this as a web developer? i tend to pass my BED (business
entity definition) objects between pages by storing in session as in:

oUser.firstName = 'whatever';
oUser.lastName = 'whatever_last';
Session["oUser"] = oUser;
Response.Redirect 'nextPage.aspx';

at the end of my web apps life, any data i really needed to persist would
be saved to sql server. is there any reason i should consider serializing
things instead of following my normal course? i'm getting ready to take
my MCTS exam shortly and would like to incorporate everything i've
learned into my day to day application development, but don't see a
practical application for serialization.
 
D

Dica

sloan said:

excellent example. tks.
Dica said:
George Ter-Saakov said:
I am not sure what you saying.

allow me to quote you...
"any data I really needed to persist would be saved to sql server."

yes, i should have clarified what i meant by that better. i wouldn't save
the state of the object to sql server, but just the values of the
object's
members. for instance:
sSql = "insert into users(firstName, lastName) values ('" + oUser.firstName
+ "', '" + oUser.lastName + "')";

i'll then have an overloaded method to recreate the oUsers object and
pass
in the userID, run a sql statement to grab the values for that particular
user, and re-populate the object's members that way. but perhaps i could
learn to save the serialized object to sql server directly and recreate the
object more effeciently that way.

tks for the reply.
Is not it a Serialization?
Very often in your applications you need to deal with objects that
needs
to be saved completely.
Like config object for example. So Microsoft came up with easy way to
do
it with XmlSerizalizer.
But nothing can stop you to write your own sterilizer that would save only
data you need.


George.




i understand the concept of serialization of objects, but do i really need
to worry about this as a web developer? i tend to pass my BED (business
entity definition) objects between pages by storing in session as in:

oUser.firstName = 'whatever';
oUser.lastName = 'whatever_last';
Session["oUser"] = oUser;
Response.Redirect 'nextPage.aspx';

at the end of my web apps life, any data i really needed to persist would
be saved to sql server. is there any reason i should consider serializing
things instead of following my normal course? i'm getting ready to
take
my MCTS exam shortly and would like to incorporate everything i've
learned into my day to day application development, but don't see a
practical application for serialization.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,007
Latest member
obedient dusk

Latest Threads

Top