Re: ANNOUNCE: Metastorage object persistence API

From: Date: Thu, 05 Dec 2002 18:55:21 +0000
Subject: Re: ANNOUNCE: Metastorage object persistence API
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-11397@lists.php.net to get a copy of this message
Hello, On 12/05/2002 04:27 PM, Bertrand Mansion wrote:
In your documentation, you state:
What is a persistence layer? Many applications need to manage information that contain the state of the processes and the entities that are involved in the applications.
Could you be a bit clearer for me and give some concrete examples where this is needed ? I am a bit ignorant on this topic. Thanks,
If you have tried with Alan's PEAR::DB_Object, you are already familiar with with concept but may with other names. Basically is an API that provides means to store and retrieve objects of a in persistence storage container like for instance a database. You may want to see the tables of a database as classes and the table rows as the classes objects. It is called persistent because once the data of the objects is stored in a database by a program, they may be rebuilt later at any stage, so they can be brought to life after the application that created the objects has ended. This is nothing that you do not do already with your database applications. The difference is that you usually you have to write code by manually to store your objects in a database, for instance the profile of a user, the articles published in a content site, the categories of articles that are published, etc.. Writing persistence API by hand is tedious and takes you some time to develop. Alan's DB_Object already helps you reducing the effort but do not avoid the need to write some code to customize your objects and eventually write some SQL. Metastorage completely avoid the need to code any parts of the persistence API. You just define a CPML (Component Persistence Markup Language) definition which is just a XML file, and it generates all the classes for you with the functions that you need. In just an half an hour you can create a persistence API for a complex data model that would take you days or weeks to develop by hand. -- Regards, Manuel Lemos

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