Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

serialization vs initialization

Posted on 2011-03-01
5
Medium Priority
?
277 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 84

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 400 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 600 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 84

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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
This article discusses how to implement server side field validation and display customized error messages to the client.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses

927 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