Thursday, October 25, 2007

Not another Flex, AmfPHP, Cairngorm CodeGen! MAKE IT STOP!

Haven't blogged in quite some time and this is a project that's been half done for far too long. Like everyone else we decided to build our own code generator, just something fairly straightforward that would generate all the DAO code, the Cairngorm code, and a nice little interface to test all the main CRUD and DAD functions we have come to know and love. Lately we've been busy souping up the generated UI, not so much in terms of style... beauty does not live here... functionality however does.

You can get all the gory details by clicking on this link:

http://www.crazedcoders.com/php/codegen.php

We built this code to use AMFPHP, Cairngorm, PHP and Flex 2.01. We've put in place validators, datepickers, checkboxes and textinputs on our forms and generated full Command/Event/Model/Controller classes. We've implemented binding on the generated view form fields. Our code generator will detect relationships between tables and render comboboxes accordingly, for example, if there's a foreign key on a customer table linked to a country table, the customer view will have a combobox linked to the model.countries collection. But I must stop, I'm getting too technical...

Basically, if the generator runs successfully, you're a few clicks away from being able to manage the data in your database from Flex. The generated code is zipped up for you to download. Inside the zip you will find a complete and ready to import Flexbuilder Project and the php packages ready to copy into your amfphp services folder. Further details can be found by clicking on the link.

5 comments:

Chad Udell said...

wow. if it works as advertised, this is some serious geek developer porn.

Unknown said...

Great job man !!!

Anonymous said...

This looks very promising. However, I couldn't meet the requirements to test it. Could you publish some sample files, so that we can see what the generated code looks like?

I created a generator too, and I'm really interrested in the DAO generation part of your tool.

Vic Rubba said...

If you click on the link again you'll see default values in all the forms, and if you click submit, the tool will generate you a complete sample project. You can grab the sql for the sample database used by the generator for this in the Notes section of the codegen form.

Chad Udell said...

Vic, very cool, ran it and got a good CRUD interface on a DB I created yesterday for a project. Not bad! The UI busts on ENUM datatypes, and it would be nice if it was a bit more rails/cakephp like in that relational fields/foreign keys weren't represented as text input fields, but rather a pull down menu filed with possible values... thoughts? feel free to contact me directly for more feedback... www.visualrinse.com