does a web developer need to worry about serialization?

Discussion in 'ASP .Net' started by Dica, Jul 3, 2007.

  1. Dica

    Dica Guest

    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.
     
    Dica, Jul 3, 2007
    #1
    1. Advertising

  2. 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.




    "Dica" <> wrote in message
    news:59sii.14571$Io4.342@edtnps89...
    >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.
    >
     
    George Ter-Saakov, Jul 3, 2007
    #2
    1. Advertising

  3. Dica

    sloan Guest

    If you have Session pointing to a backend Sql Server, then YES you need to
    have serializable objects.

    Check my SessionWrapper object (with Generics)

    http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!151.entry



    "Dica" <> wrote in message
    news:59sii.14571$Io4.342@edtnps89...
    > 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.
    >
    >
     
    sloan, Jul 3, 2007
    #3
  4. Dica

    Aidy Guest

    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.

    "Dica" <> wrote in message
    news:59sii.14571$Io4.342@edtnps89...
    >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.
    >
     
    Aidy, Jul 3, 2007
    #4
  5. Dica

    Dica Guest

    "George Ter-Saakov" <> wrote in message
    news:...
    >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" <> wrote in message
    > news:59sii.14571$Io4.342@edtnps89...
    >>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.
    >>

    >
    >
     
    Dica, Jul 3, 2007
    #5
  6. Dica

    sloan Guest

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




    "Dica" <> wrote in message
    news:Xwtii.20151$tB5.4793@edtnps90...
    >
    > "George Ter-Saakov" <> wrote in message
    > news:...
    > >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" <> wrote in message
    > > news:59sii.14571$Io4.342@edtnps89...
    > >>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.
    > >>

    > >
    > >

    >
    >
     
    sloan, Jul 3, 2007
    #6
  7. Dica

    Dica Guest

    "sloan" <> wrote in message
    news:...
    > Then look at my other entry:
    > http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!140.entry


    excellent example. tks.

    >
    >
    >
    >
    > "Dica" <> wrote in message
    > news:Xwtii.20151$tB5.4793@edtnps90...
    >>
    >> "George Ter-Saakov" <> wrote in message
    >> news:...
    >> >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" <> wrote in message
    >> > news:59sii.14571$Io4.342@edtnps89...
    >> >>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.
    >> >>
    >> >
    >> >

    >>
    >>

    >
    >
     
    Dica, Jul 3, 2007
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Valentin Tihomirov

    Don't worriy assignment, when to worry about?

    Valentin Tihomirov, Oct 26, 2003, in forum: VHDL
    Replies:
    0
    Views:
    526
    Valentin Tihomirov
    Oct 26, 2003
  2. Replies:
    0
    Views:
    460
  3. Zach
    Replies:
    14
    Views:
    1,868
    Zach Uram
    Apr 12, 2009
  4. Don't worry

    , Jun 3, 2009, in forum: C++
    Replies:
    0
    Views:
    332
  5. Angila
    Replies:
    0
    Views:
    255
    Angila
    Mar 13, 2011
Loading...

Share This Page