Cairngen 2.0

It has been awhile since the release of Cairngen 1.0, and the feedback I have received from the community has been very encouraging. I am happy to have provided a first-of-it’s-kind utility which allows developers to save time when building Flex applications on Adobe Cairngorm. Additionally, many of you have contacted me with some really cool new features that you have added, some of which are now available in this latest release.

Objective
The main objective of Cairngen 2.0 was to address 2 issues which were inherent to Cairngen 1.0. The first being that Event / Command mappings were not automated. In Cairngen 1.0 developers had the ability to generate sequences which consisted of an Event, Command and optional Business Delegate. And although this was very useful as it generated all of the required classes, handled upcasting events and instantiating Business Delegates, developers were still required to implement addCommand() in the FrontController manually. The second issue was that Event types were not generated as uppercase. Event types are static constants therefore they should always be uppercase. This is not required, however it is a best practice. Again developers could easily generate the required Event class but they would have to manually modify the event type to make it uppercase.

These two issues were the main thing preventing Cairngen from full circle code generation and implementation. Cairngen 2.0 addresses these 2 issues by automating the process, thus allowing for even faster development of Cairngorm projects.

So what’s new in Cairngen 2.0?

  • FrontController addCommand automation
    Event / Command mappings via the FrontController are now automated. When generating a sequence (Event, Command, Business Delegate) the FrontController will be modified to implement an additional addCommand for the Event and Command. This is achieved by a simple //todo comment which is uses as a token and replaced when sequences are generated.
  • Event TYPE
    Event type constants are now generated as upper case. Additionally the value of the event type is set to the fully qualified namespace of the event, thus preventing it from possible collisions with other Events.
  • User prompted before deleting
    You will now be prompted prior to deleting directories in Cairngen 2.0. You can override this by setting the new “prompt.on.delete” property to false
  • Class file copyright header
    Developers can add a specific copyright header for each class file generated. When specified the header will be added before the package definition.
  • Remote class VOs
    The ability to generate and register remote classes with a VO is now available
  • Logging
    Developers can toggle between logging the console output. This can be accomplished by setting the “log.output” property to true or false
  • What’s next?
    I don’t know, you tell me? If you have additional features you would like to see added to Cairngen, or if you have extended Cairngen to provide these features, feel free to leave a comment on this page. I am planning on adding some new features in the near future. One of which will be the ability to detect duplicate addCommands.

    I would like to thank the many developers who have contributed to the development of Cairngen 2.0. I am in the process of compiling a list of contributors, at which point I will update the release notes.

    Cairngen is licensed under the MIT License.

    Ant and Ant-contrib are licensed under The Apache Software License

    Download Cairngen 2.0

    { 6 comments to read ... please submit one more! }

    1. This is great, thanks!

      If you want more for whats next, how about ability to create multiple sequences/vos at once?

      Normally when I start a new project there are quite a few things I know I’ll need to create up front. Like say I wanted to create some shopping application

      sequence.name = Login
      sequence.name = Logout
      sequence.name = Register
      sequence.name = ForgotPassword
      sequence.name = AddToCart
      sequence.name = RemoveFromCart
      sequence.name = Checkout

      vo.name = User
      vo.name = ShoppingCart
      vo.name = Product

      then have cairngen take care of it in 1 shot

    2. Actually a target has already been created which does just that. It was submitted by one of the contributors. I just need to further test it and it will be in the next minor release.

      Stay tuned.

      – Eric

    3. Hey Eric,

      Is there a cairngen dev list.
      I made a bunch of template additions to v1 that may be useful.

    4. How about introducing unit testing templates into the code gen?

    5. Hey Bjorn,

      Currently there isn’t an actual dev list other than here. Anyone who would like to contribute to Cairngen can do so by sending me an email.

      Introducing Unit tests in Cairngen is currently on the to do list. If you have anything you would like to share shoot me an email and we can discuss off-line.

      Thanks,
      Eric

    { 0 Pingbacks/Trackbacks }