NYCPHP Meetup

NYPHP.org

[nycphp-talk] DataObjects generator

Kenneth Downs ken at secdat.com
Sat Nov 19 07:20:59 EST 2005


I think I phrased my question badly.

What I should have said was that as the complexity of your generator
increases, and as the table count increases, running the generator becomes
more and more of a delay.  If the generator produced an assoc array of
layout, you would only need to run it when layout changed, and your system
would be much more flexible both in terms of development and deployment.

I have a system of 170 tables and re-running the generator is just not an
option when I'm trying to tweak a bug, I want to modify the code directly
and see the effect.  When it is fixed, it goes into the distribution tree
and all systems using that library file are affected w/o rerunning any
generators.

> After tweaking the generator, a simple refresh of my browser allows me to
> see the output of the script generated and the output from executing each
> method in the DataObject. Since this refresh has the database and table
> info
> already and the assoc array - $_POST is still available.
>
>
> On 11/18/05, Kenneth Downs <ken at secdat.com> wrote:
>>
>> Have you considered simply dumping out associative arrays that describe
>> each table, and then having single library of code that handles them?
>> This gives you the flexibility to see the code's efficacy in real-time
>> as
>> you work on it -- without having to run the generator for every little
>> tweak -- and then having it save cached chunks of HTML as it goes.
>>
>> > I've developed a tool that creates a DataObject for each table I have
>> in
>> > my
>> > MySQL database. When the script is executed against a particular table
>> it
>> > generates a script containing OO code with a number of methods defined
>> by
>> > default e.g. set_/get_ , getAll, get, insert, delete, update, and a
>> error
>> > method.
>> >
>> > It has also been fun finding ways to use the DataObjects. As a result,
>> I
>> > have put together a couple of examples;
>> > Using a single DataObject :
>> http://cthorn.com/oodbigen/usingdataobject.php
>> > MVC wrapper for the DataObjects :
>> > http://cthorn.com/oodbigen/mvcwrapper.php
>> >
>> > Hope someone finds this useful. Feedback welcomed..
>> >
>> > Chauncey Thorn
>> > PHP App. Developer
>> > email: chaunceyt at gmail dot com
>> > url: http://www.cthorn.com/
>> > _______________________________________________
>> > New York PHP Talk Mailing List
>> > AMP Technology
>> > Supporting Apache, MySQL and PHP
>> > http://lists.nyphp.org/mailman/listinfo/talk
>> > http://www.nyphp.org
>>
>>
>> --
>> Kenneth Downs
>> Secure Data Software
>> 631-379-0010
>> ken at secdat.com
>> PO Box 708
>> East Setauket, NY 11733
>>
>> _______________________________________________
>> New York PHP Talk Mailing List
>> AMP Technology
>> Supporting Apache, MySQL and PHP
>> http://lists.nyphp.org/mailman/listinfo/talk
>> http://www.nyphp.org
>>
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org


-- 
Kenneth Downs
Secure Data Software
631-379-0010
ken at secdat.com
PO Box 708
East Setauket, NY 11733




More information about the talk mailing list