Programming and Technology
RSS icon Home icon
  • Dynamically Manage Models with Zend_CodeGenerator

    Posted on January 19th, 2010 brandon 2 comments

    The holidays have passed and at last I’ve gotten enough of my obligations out of the way to begin to innovate on some new code as well as play with some of the new offerings in the latest versions of the Zend Framework. I’ve been most interested in particular with Zend_CodeGenerator since I have spent a lot of time in the last year writing boilerplate code for various projects. I find that the bulk of my time is spent prototyping models so I figured it would not be hard to build a model scaffolding script not unlike the ‘rake’ command in ruby on rails and similar commandline tools offered by the many application platforms out there. Rather than killing my wrists pounding out models, their various attributes and associated mutators/accessors, I decided that my time would be more efficiently spent describing my models using a short hand format (preferably xml) and then having a script translate that into actual classes and files. The Doctrine ORM allows you do this very thing translating YAML into Doctrine Models. This was very interesting to me but I chose to take it a step further and have it build all of my Domain Model infrastructure while it was at it (This includes the models, the gateway classes, and the DAO classes).

    Read Entire Article


Get Adobe Flash playerPlugin by wpburn.com wordpress themes