Re: Re: OO -> RDBMS mapping

From: Date: Fri, 01 Nov 2002 11:09:07 +0000
Subject: Re: Re: OO -> RDBMS mapping
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-10417@lists.php.net to get a copy of this message
Hello, On 11/01/2002 07:57 AM, Andi Gutmans wrote:
Has there been any talk on developing something similar to JDO (Java Data Objects) in PEAR? I think it'd be a very interesting thing for PHP. It is often much easier to fetch database objects, change them and commit than using SQL.
What a coincidence! As you may have noticed I just posted announcement regarding data persistence layer module for MetaL compiler engine that addresses these issues. I know Alan Knowles has been working on something that could be the start of what you have in mind, but what I developed in not really an API to do generic object persistence but rather something that creates all the classes and database schemas you need to handle persistence for you.
Well that is more or less what I had in mind. You write an XML of your classes and it creates your DB schema and the PHP classes for you. It could also be done by the developer creating the PHP classes and the DB schema being created automatically.
Well MetaL persistence module does all for you: creates a factory class that is creates objects of the classes that you defined in the XML, creates the database schema definition and a class to install it. In the future it will generate documentation for the API of the classes that it generated (this is easy), generate classes to create and validate forms, generate classes to produce reports. Currently I am concerned with the persistence API which is only partially implemented. Since I need it to develop several medium sized systems that I am working on for the business of my company, it will have the greatest priority and I expect to be up to a very useful level soon.
I'm not exactly sure what your persistence layer is and how close it is to what I am thinking of.
That's it. The layer is the API that isolates you from having to do direct access to the storage API. In this case it is a relational database, but it could be XML files or LDAP based storage. It is named persistence because the object outlive the programs that created them. -- Regards, Manuel Lemos

« previous php.pear.dev (#10417) next »