You are here: Re: Store and retrieve objects on server « PHP Programming Language « IT news, forums, messages
Re: Store and retrieve objects on server

Posted by NC on 08/23/07 21:22

On Aug 23, 1:48 pm, grossespi...@gmail.com wrote:
>
> Is there an efficient way of storing an instance of
> a PHP-class on the server and retrieving it based on
> its ID? I would need it in an AJAX-webpage in order
> to find the server-object corresponding to the HTML-
> element that sent the request.

You really should reconsider your architecture. What you have in mind
seems to be unnecessarily complicated and unduly influenced by
Java... What, in your opinion, is the advantage of storing an object
compared to recreating it on the basis of data received?

> The ideas I have had so far:
[skip]
> - store the object in the $_SESSION variable -- this works
> but I don't thing it is the right way of doing it
>
> - store the object serialized in a file

The two solutions outlined above are conceptually the same; native PHP
sessions are stored in files.

> Any ideas are welcome.

You can store serialized objects in a database. Or you can just
figure out how to avoid having to store objects altogether...

Cheers,
NC

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация