Thursday, November 03, 2005

Structure generation and Zope 3

Ruby on Rails has been (unfairly) criticized by some outsiders because of its use of code generation to create a project, but David Heinemeier Hansson explains that RoR, rather than generate lots of code at the start of a project, generates instead the complete structure of the project with barely a few lines of code.

He goes on to extol the virtues of what he calls structure generation, which in a way complement Rails mantra of convention instead of configuration with the corollary of convention through code instead of documentation.

Structure genaration is not anything new, of course. AppFuse is a very popular application that does just this for Java web applications. But still, I think he is right. It is much easier for a new developer to type generate model than to have to remember which files are needed and where to put each file.

Although Zope 3 does value configuration greatly (at the point of having a special language, ZCML, specifically for configuration), projects would really benefit from such an approach where initial project set up is concerned. Just look at the very helpful Benji York's Zope 3 Quick Start guide. There are several places in this document where he instructs the user to create a specific file or directory. Wouldn't it be a lot better if Zope 3 users could just type one command and have this structure generated for them?

There may be some third party scripts that do this already, but I think something like this should come with the core framework. It's not that Rails is so much better than every other web app framework (it isn't), but these little touches go a long way in reinforcing this perception with many developers.


At 3:45 AM, Anonymous Anonymous said...

There is ArchGenXML from the Plone world, which is being rebuild as agx (to work with Zope3 or Five) to create a product frame from an UML model.

At 12:16 PM, Blogger Carlos de la Guardia said...

Re: ArchGenXML. Yeah, but I would like something integrated into the core Zope 3, not an add-on product. Besides, how many developers really would create an UML model beforehand for a simple application?

At 3:27 AM, Blogger Duncan McGreggor said...

Hey Carlos, I created a script that does just this and published it on the site. It is admitedly alpha, but I and other friends have beeen using it for a while now to stub out new z3 sites.

Here's the link:

I would love it if others felt like contributing and we could push it into beta and beyond...


Post a Comment

<< Home