asbeans: A Sample Hamachi Module for ActionScript Codegen
March 7, 2007 on 11:35 pm | In Flex, Programming | 3 CommentsIn conjunction with a talk I just gave at 360Flex on code generation, I’ve posted a proof-of-concept Hamachi module for generating ActionScript value objects and Cairngorm command/event classes. It’s called asbeans (downloadable from the link you just read). Here are the slides — at least, a backup draft of them, after PowerPoint turned the final version into a zero-length file.
(Hamachi is a really cool open-source project developed by my colleague Nate Abramson, one of the smartest people ever. It could be loosely described as a code generator generator.)
To install asbeans, unpack it in the samples/ directory of the hamachi-0.1 distribution (right next to the simplebeans/ directory).
Disclaimer: asbeans is just a very simple example of how to use Hamachi to generate AS code, but not really a full-blown system. It does generate code that compiles, but I don’t use Cairngorm much and I have not actually used the code it generates in an application.
At Allurent, we do use Hamachi to generate code that we rely on, though! Just not with this simple asbeans module. We have other, more complex modules that generate web service definitions, HTML documentation, and so on. Pretty cool.
3 Comments »
RSS feed for comments on this post. TrackBack URI
Leave a comment
Entries and comments feeds.
Valid XHTML and CSS.
All content copyright (c) 2006-2007 Joseph Berkovitz. All Rights Reserved.
Joe,
I have always been looking for good code generators. Hamachi seems very promising. I havent yet fully understood the tool. Can it work directly database? So far I use xslt and xdoclet2 based on customized templates. It works ok after a lot of pretty complex customization. Hoping that Hamachi will ease it.
-Shailesh
Comment by Shailesh Mangal — March 8, 2007 #
Shailesh,
I believe Hamachi should be able to generate SQL, if that’s what you mean. We don’t use it that way, however.
I have used xdoclet2 and xslt extensively in the past. Xdoclet2 is perhaps more comparable since it also uses Velocity templates. I find xdoclet2 rather obscure sometimes, and the reliance on Java annotations forces one to model everything as a Java interface or class, which is sometimes very awkward.
At Allurent we use Hamachi very extensively and I’m very happy with it relative to xdoclet2. I am much more comfortable defining the model in XML.
Comment by joe — March 8, 2007 #
Joe,
Great tool now I need to work on the Java skills to dig deeper. I tried to compile the Cairngorm model and it didn’t work seems to not be able to find the data model class Beans corresponding to the attribute. I’ll keep trying and post if I can get it working. Thanks again for another great tool!
Comment by Paul Rangel — April 13, 2007 #