Database table access class generator
Posted: Sat May 22, 2004 6:47 am
I'm not sure if this is right place to ask comments for this php tool.
I've been developing some sort of code generator for php. Since my experience in pure programming area is only few years i decided to ask some comments and advices from you fellows, if it's ok? I have found very time consuming to make scripts and functions to access database and dozens of tables, insert, update, delete and get rows from there. So i made a little generator to do primary or may i say, initial work for me.
Generator builds up four files. Three of them are classes and one is a test file. Before generating files, user must know the name of the class, which he is going to produce. Most likely the name will be the same or at least have very close connection to the target table name. Second user must know all the columns in table and finally he must know the name of the target table, which is controlled by these classes. With these information code generator can build two of the three previously mentioned classes. Third class is a database connection class and it will need some connection and authentication information.
Two primary classes are 1) main class, that is an actual object presentation of the table and 2) database logic layer class for the main class. In real applications only the first one is used to access database table. Test file will show how the main class is used. It's very simple and effective, i think. Still a lot of work is left for the programmer because all class field data types will be a string type, as form (generator uses online form to get all needed informations) doesn't ask any data types for table columns.
I have placed code building tool to the website. There is a form, that can be submitted right away with default settings and see the results. For more deeper testing user can fill necessary fields and build up his own classes. The form is on:
http://mcenter.artesaani.net/OWAB/DbCla ... r/form.php
or documentation on:
http://mcenter.artesaani.net/OWAB/
where you must select PhpDbClassGenerator and it's sublinks. Documentation is on construction. I need some user experiences before publishing / contributing this tool more public. I would appreciate your comments. Thanks.
I've been developing some sort of code generator for php. Since my experience in pure programming area is only few years i decided to ask some comments and advices from you fellows, if it's ok? I have found very time consuming to make scripts and functions to access database and dozens of tables, insert, update, delete and get rows from there. So i made a little generator to do primary or may i say, initial work for me.
Generator builds up four files. Three of them are classes and one is a test file. Before generating files, user must know the name of the class, which he is going to produce. Most likely the name will be the same or at least have very close connection to the target table name. Second user must know all the columns in table and finally he must know the name of the target table, which is controlled by these classes. With these information code generator can build two of the three previously mentioned classes. Third class is a database connection class and it will need some connection and authentication information.
Two primary classes are 1) main class, that is an actual object presentation of the table and 2) database logic layer class for the main class. In real applications only the first one is used to access database table. Test file will show how the main class is used. It's very simple and effective, i think. Still a lot of work is left for the programmer because all class field data types will be a string type, as form (generator uses online form to get all needed informations) doesn't ask any data types for table columns.
I have placed code building tool to the website. There is a form, that can be submitted right away with default settings and see the results. For more deeper testing user can fill necessary fields and build up his own classes. The form is on:
http://mcenter.artesaani.net/OWAB/DbCla ... r/form.php
or documentation on:
http://mcenter.artesaani.net/OWAB/
where you must select PhpDbClassGenerator and it's sublinks. Documentation is on construction. I need some user experiences before publishing / contributing this tool more public. I would appreciate your comments. Thanks.