Re: Abstraction layer or not?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

On 11/05/2002 11:21 PM, Leif K-Brooks wrote:
> I'm working on a new site, and I'm wondering whether to use an 
> abstraction layer or not.  I don't have any plans to switch DB system, 
> but you never know what the future holds.  I figure that there's no 
> reason not to, but are there any down sides?  Which abstraction layers 
> are good?

There is another point on using abstraction layers which is the fact 
that since many people use the same API, all can share the eventual 
tools and components based on that API.

For instance, I am developing a data persistence layer generator that is 
able to generate code and database schemas from a description in XML of 
the structure of a set of classes and the relationships that exist 
between them.

The generator creates the modelled classes and a database schema to 
provide persistent storage for the classes objects. The classes provide 
an API to retrieve and store the objects according to your application 
as described in the model description in XML. See below for a simple 
example.

With this tool you no longer need to put up with the tedious work of 
setting databases, write SQL by hand, write code to retrieve and store 
the data, etc.. This way you can speedup the development of your 
application often by more than an order of magnitude.

The generated code and database schema description (also in XML) is 
based on Metabase database abstraction, so anybody using Metabase can 
benefit from this tool.

Read more about this here:

http://www.meta-language.net/news-2002-11-01-persistence.html

http://www.phpclasses.org/metabase

-- 

Regards,
Manuel Lemos


<?xml version="1.0" encoding="iso-8859-1"?>
<!--
      @(#) $Id: cms.component,v 1.3 2002/11/06 01:52:52 mlemos Exp $
   -->
<component>
	<name>cms</name>
	<description>Content management system component</description>

	<class>
		<name>article</name>

		<variable>
			<name>title</name>
			<type>text</type>
		</variable>

		<variable>
			<name>lead</name>
			<type>text</type>
		</variable>

		<variable>
			<name>body</name>
			<type>text</type>
		</variable>

		<variable>
			<name>author</name>
			<class>author</class>
		</variable>

		<variable>
			<name>creation_date</name>
			<type>timestamp</type>
		</variable>

		<collection>
			<name>categories</name>
			<class>category</class>
			<reference>articles</reference>
		</collection>

	</class>

	<class>
		<name>author</name>

		<variable>
			<name>name</name>
			<type>text</type>
		</variable>

		<collection>
			<name>articles</name>
			<class>article</class>
			<reference>author</reference>
		</collection>

	</class>

	<class>
		<name>category</name>

		<variable>
			<name>name</name>
			<type>text</type>
		</variable>

		<variable>
			<name>description</name>
			<type>text</type>
		</variable>

		<variable>
			<name>parent</name>
			<class>category</class>
		</variable>

		<collection>
			<name>children</name>
			<class>category</class>
			<reference>parent</reference>
		</collection>

		<collection>
			<name>articles</name>
			<class>article</class>
			<reference>categories</reference>
		</collection>

	</class>

	<schema>

		<function>
			<name>installschema</name>
			<type>installschema</type>
		</function>

	</schema>

	<factory>

		<function>
			<name>getarticle</name>
			<type>getobject</type>
			<parameters>
				<class>article</class>
				<id>
					<argument>article</argument>
				</id>
			</parameters>
		</function>

		<function>
			<name>getauthor</name>
			<type>getobject</type>
			<parameters>
				<class>author</class>
				<id>
					<argument>author</argument>
				</id>
			</parameters>
		</function>

		<function>
			<name>getcategory</name>
			<type>getobject</type>
			<parameters>
				<class>category</class>
				<id>
					<argument>category</argument>
				</id>
			</parameters>
		</function>

	</factory>

</component>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux