Solved

serialization vs initialization

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

735 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