RE: [PEAR-DEV] Framework Development
| From: | Lukas Smith | Date: | Fri, 14 Jun 2002 11:07:53 +0000 |
| Subject: | RE: [PEAR-DEV] Framework Development | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-7015@lists.php.net to get a copy of this message | ||
You may want to look at MDB (either in pear cvs or by running "pear
install MDB" or www.dybnet.de/MDB).
MDB is a merge of PEAR DB and Metabase that will eventually become PEAR
DB 2.0 (its still in beta and currently only has a Mysql driver)
Anyways if you really want to have the backend do the entire SQL stuff
than maybe xml schema support might also interest you. Using this you
could automagically create the schema for the defined object. Even
better if the object is changed you could have MDB write the necessary
alter statements as well by comparing an old and a new xml schema file.
Best regards,
Lukas Smith
smith@dybnet.de
_______________________________
DybNet Internet Solutions GbR
Reuchlinstr. 10-11
Gebäude 4 1.OG Raum 6 (4.1.6)
10553 Berlin
Germany
Tel. : +49 30 83 22 50 00
Fax : +49 30 83 22 50 07
www.dybnet.de info@dybnet.de
> -----Original Message-----
> From: Simon Biela [mailto:s.biela@kernpunkt.de]
> Sent: Friday, June 14, 2002 12:06 PM
> To: pear-dev@lists.php.net
> Subject: [PEAR-DEV] Framework Development
>
> Dear PEAR-Developers!
>
> We are just starting to develop a framework for eBusiness projects,
which
> might be interesting for you. It's kind of difficult to explain in my
poor
> english, but I think the attached code-examples (not working) should
give
> you an idea of what we want to do. If you can't use it in PEAR, I
anyways
> would love to get a feedback from you.
>
> Basically we are building a base class "KBDBObject" which gives
developers
> the power of building object-oriented objects which are managed in a
> database. No need to worry about any SQL Calls or cookie-handling. The
> base-class will use ADODB to send the constructed SQL92-conform
queries to
> the database.
>
> Building a new object for usermanagement in your project will be as
easy
> as:
>
> class KBUser extends KBDBObject
> {
> function KBUser($_db)
> {
> $this->db = $_db;
> $this->table = 'users';
> $this->keycolumn = 'id';
> $this->allowedfields = array();
> array_push($this->allowedfields, 'id');
> array_push($this->allowedfields, 'username');
> array_push($this->allowedfields, 'password');
> }
> }
>
> You could then work with the user:
>
> // reading userdata and saving the object for using on other pages
> $myUser = new KBUser();
> $myUser->save_in_cookie();
> $name = $myUser ->getField(name);
>
> You could display userdata in a form i.e. with a template toolkit.
> Maybe you want to write userdata coming from a form in the database.
>
> // updating userdata
> $myUser->setField(name,"Jon Doe");
> $myUser->write_to_database();
>
> The "KBDBObject"-Class will worry about the rest. The attached example
is
> not working at all and only meant for flat tables at the moment.
> Dependencies to other tables (relation-tables, foreign-keys) will also
be
> supported. So it would be possible to extend a user-object with rights
(n-
> m relation) or groups (could be 1-m relation)
>
> Once finished, we want to build different toolkits for typical
eBusiness
> Applications with this toolkit and link to existing other toolkits:
>
> user management
> shopping cart
> order management
> product management
> base-data management
> export and import (i.e. XML)
>
> to name some of our ideas.
>
> I hope this idea isn't completely stupid.
>
> best regards
> Simon Biela
> management
>
> ---
> kernpunkt GmbH
> cross communication
> Krefelder Strasse 18
> 50670 Koeln
>
> tel: +49 221 - 569 576 10
> fax: +49 221 - 569 576 29
> infoline: 0800 KERNPUNKT
>
> s.biela@kernpunkt.de
> http://www.kernpunkt.de