DAO Generator Design
Posted: Thu Nov 30, 2006 6:00 pm
hey all
i'm about to embark on creating a DAO generator, which not only generates the php code for the class for each table, but also generates all the sql stored procedures thus enabling the php classes to access only stored procedures rather then sending long sql strings to the database, i have had a look arround at some DAO generators, or extenable classes already and whilst there are some good basic ones i'm just not happy with the crap they send to the database.
Now my class structure will look like this :
- > BaseClass (All the functions for database and functions for differant datatypes, eg date functions etc)
- > DAO (using base class to access DB via stored procs, this is what will be generated)
->Business Logic for each generated class (Will extend the DAO, but will not change when database is rebuilt, and dao regenerated)
- > Php script (using smarty template or include html files with php variables included, like a light light smarty templte)
- > smarty template / html file
So i have a few questions regarding this design
Is it too code heavy, and will that affect it speed in a big way, as in having to load so many files and classes for one page execution?
How good is php accelerator for solving this?
Is there a DAO generator that already uses Stored procedures?
What other pro's - con's can you see?
Many thanks in advance
glen
i'm about to embark on creating a DAO generator, which not only generates the php code for the class for each table, but also generates all the sql stored procedures thus enabling the php classes to access only stored procedures rather then sending long sql strings to the database, i have had a look arround at some DAO generators, or extenable classes already and whilst there are some good basic ones i'm just not happy with the crap they send to the database.
Now my class structure will look like this :
- > BaseClass (All the functions for database and functions for differant datatypes, eg date functions etc)
- > DAO (using base class to access DB via stored procs, this is what will be generated)
->Business Logic for each generated class (Will extend the DAO, but will not change when database is rebuilt, and dao regenerated)
- > Php script (using smarty template or include html files with php variables included, like a light light smarty templte)
- > smarty template / html file
So i have a few questions regarding this design
Is it too code heavy, and will that affect it speed in a big way, as in having to load so many files and classes for one page execution?
How good is php accelerator for solving this?
Is there a DAO generator that already uses Stored procedures?
What other pro's - con's can you see?
Many thanks in advance
glen