|
Posted by Jerry Stuckle on 12/02/07 19:39
Viator wrote:
> Hi folks,
>
> I have a basic question. When I do object-oriented programming
> using C++ or Java, all my objects reside in RAM. I do not have
> to think about storing and retrieving them, because they are
> in RAM and that space has been allocated for them and
> the program is continually running, so neither program nor
> objects are going to disappear.
>
> It seems to me, having never done OOP in PHP, that this
> arrangement would not exist in PHP, because program+objects
> only exist when a page is being constructed. In the meantime,
> where are the objects? You might say, "in my MySQL database",
> and that is certainly a capable storage medium, however
> it takes time to get them out, and to store them back into it.
>
> So the question is, I think, appropriate. Since PHP has
> (AFAIK) no object storage other than a database, is
> OOP in PHP really appropriate?
>
> If there is some other storage medium can you tell me what it is?
>
> If there isn't another faster storage medium than a database,
> why doesn't someone create one, to improve efficiency?
>
> Thanks.
Your problem is web programming requires a different design.
Web pages are transactional in nature. That is, the browser makes a
request, the page starts, processes the request and terminates (one
transaction). When the user does something to create another request,
the process repeats.
Most C/C++ programs are not like this - they start and keep going across
multiple requests.
But this does not affect OO design and usage. It is still very much
appropriate for transactional programming. You don't have to save the
objects to make them useful.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Navigation:
[Reply to this message]
|