Solved

serialization vs initialization

Posted on 2011-03-01
5
262 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 83

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 83

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

911 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

23 Experts available now in Live!

Get 1:1 Help Now