Re: Is OOP really appropriate for PHP?
- From: "C. (http://symcbean.blogspot.com/)" <colin.mckinnon@xxxxxxxxx>
- Date: Mon, 3 Dec 2007 05:23:50 -0800 (PST)
On 2 Dec, 14:56, Viator <varioustr...@xxxxxxxxx> wrote:
Hi folks,As the other correspondents have pointed out - that is the case with
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.
PHP as long as the current thread is being executed. It is also true
of Java and C++ when invoked as a new execution thread via CGI - most
commonly for Java complex applications are implemented via containers
where a significant part of the process continues after the request
thread is completed.
You shouldn't have to think too much about storing/retrieving data
with PHP - read up on sessions. This of course does not address the
class definition part of an object - you can manually reference the
definitions within your code but its a lot simpler to adopt a
consistent approach to where you keep these and use the autoload
functionality (loading of a definition of a class instantiated in the
session is deferred).
however
it takes time to get them out, and to store them back into it.
Most Web based Java applications have a similar problem/overhead
because the session has to replicate across the nodes - IME this is
much more painful than PHP's session handling which is intrinsically
at the storage layer.
(I also have a pet peeve about ORM - I think its a bad idea)
So the question is, I think, appropriate. Since PHP has
(AFAIK) no object storage other than a database, is
OOP in PHP really appropriate?
You don't have to use a database. By default sessions are stored on
the filesystem but you can put them anywhere you can access via PHP -
a database or shared memory are obvious candidates. The filesystem can
easily be in RAM if you like.
Why do you think it's not fast enough?
C.
.
- References:
- Is OOP really appropriate for PHP?
- From: Viator
- Is OOP really appropriate for PHP?
- Prev by Date: Re: What function allows conversion md5 in text
- Next by Date: Re: Multidimensional array - search for relationships
- Previous by thread: Re: Is OOP really appropriate for PHP?
- Next by thread: Re: Is OOP really appropriate for PHP?
- Index(es):
Relevant Pages
|
|