Solved

serialization vs initialization

Posted on 2011-03-01
5
259 Views
Last Modified: 2012-05-11
Hi, which is more effective, I initialize a User object and the need to pass it to the next page
Should I serialize and store in the session or perform the same initialization on the next
page ?
0
Comment
Question by:Rozamunda
  • 2
  • 2
5 Comments
 
LVL 82

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 100 total points
ID: 35014646
If that is all there is to it, might as well do the initialization and avoid the session overhead.
0
 
LVL 36

Expert Comment

by:Loganathan Natarajan
ID: 35014698
It is better you initialize it on the next page and do the process.
0
 

Author Comment

by:Rozamunda
ID: 35014799
Thanks, how about using object registry ? (MVC concept)
0
 
LVL 36

Accepted Solution

by:
Loganathan Natarajan earned 150 total points
ID: 35014840
one more point, try to avoid the storing objects with session .. it will consume lot of spaces and slow down your app.

In fact you can use MCV concept way the storing and retrieving the objects on the pages.
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 35014875
The only reason for storing the information is for it to be reused and altered.  If the information is static, put it in an include file that gets used whenever needed.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now