First, here's what I've done so far in the subject:
http://dbobj.sourceforge.net/bzr/dbobj/

And here's a quite dreary wiki feel free to update it...
http://dbobj.sourceforge.net/wiki/HomePage

However, there are some notes on these:
1, I didn't spend much time on documentation writing, because both the
API and the internal workings are still very flexible. But you can have
a look the two tests applications I use (dbobj.php, forum.php), to get
some idea of how things work.

2, I've only finished modularising the database layer last day. So the
current code is REALLY UNSTABLE, it'll probably segfault if you try it
out. However, I'd like to receive crash reports (preferably with some
debugging information).

3, The current version has really BAD error handling, I'll implement
some exception based thing in the future.



Secondly, the answers to your questions

> Just curious - which access do you need that PHP API doesn't give?

I didn't see any way for a PHP class to nicely handle

$myobject->i++;

where MyClass::i doesn't exist, and this should be relayed to some magic
function like __set;

I also don't know how well __get and __set behaves with references.

> What do you mean by virtual functions? If you mean C++ meaning, all 
> class methods in PHP are "virtual".
> 

Yeah, I know that.

> Why would it be that different in C - you'd still have to define the 
> same classes and same objects and play by the engine rules?

1. no doubt C is more complex, but it also gives more freedom (eg. for
caching the mapping configuration in memory)

2. In C I can implement all the structure I want (as long it's sane)
without much worrying about what performance cost it will have. I
wouldn't do the same in PHP. I'm talking about separate classes for
every database column type and abstract data type; separate object for
every value I get from the database, and present to the script. That's a
lot, and I don't think I would use this structure in PHP.

So I wanted to point out, that C code could have nicer (more OO)
structure, then PHP code. And that good structure means good
manageability, even in a complex language like C (compared to PHP). Of
course only if it is accompanied by good documentation.

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to