InfoQ

InfoQ

News

My Bookmarks

Login or Register to enable bookmarks for unlimited time.

The content has been bookmarked!

There was an error bookmarking this content! Please retry.

Enterprise Flex with Anvil

Posted by Jon Rose on Feb 04, 2009

Sections
Architecture & Design,
Development,
Enterprise Architecture
Topics
Web 2.0 ,
Java ,
Rich Client / Desktop ,
Rich Internet Apps
Tags
Adobe ,
Adobe Integrated Runtime ,
Flash ,
Flex

In this post, Anvil project founder Ryan Knight shares about his open source project with InfoQ.com. Anvil is an open source project that was built to help make Enterprise Flex development easier. In addition, it provides a portal environment for running Flex applications.

First, Ryan provided InfoQ an overview of Anvil:

A little bit of history might help explain Anvil. In May 2007 I started a project for Williams Gas Pipelines writing a new Enterprise Flex project. At the time Flex was just starting to be used in the enterprise for large applications. We could see there where going to be a lot of challenges to creating a large application in Flex, so we enlisted the help of James Ward, a Flex Evangelist from Adobe. He provide a lot of the early guidance of how to modularize the application, how to handle events at different layers of the applications, etc. As part of this collaborative effort we decided to start an open source project around this core framework.

What has been nice about having Anvil as part of the core frame work of an actual project, is I have been able to contribute a lot of my work done at Williams to the open source community. Also it has been heavily used, so a lot of the most obvious bugs have been worked out. Also during this time we have met several times with James to get architectural direction and help with coding. What you have today then is a high-level framework that solves some of the biggest challenges developers will face when building large Flex Application. Today Anvil provides a number of useful pieces, such as a layout environment, security that integrates with Spring Security, module loading and management and many other things. It also provides a portal framework based on the Flex MDI project (now part of FlexLib). This provides layout and window management.

Next, Ryan shared how Anvil differs from other Flex frameworks:

Anvil tackles a different set of problems than frameworks like Mate and Cairngorm. Those frameworks address the lower level issues of MVC. Anvil is focused more on the large picture of how do we effectively architect large applications in Flex. In most cases it can be used with other frameworks like Mate. We did find that Cairngorm does not work though, because Cairngorm assumes only one copy of the MVC. With modules you might have the same module loaded multiple times, so in essence you have a micro MVC for each module. This paradigm breaks in Cairngorm for example when a module fires an event to update the model. This update should be isolated to a single module, but Cairngorm propagates the event globally.

On Anvil's licensing:

Apache 2.0 - use as as desired but just let use know what you are doing with it.

Ryan then shared how others can benefit from Anvil:

I have always learned best from the code of others. For example one of the most difficult part of the project was putting together the ant build process. To figure out how to do this I actually copied a lot of ideas from Googles GWT project build process. So even if you already have an application well under way, I think there is a lot that can be learned from Anvil. It was a huge learning curve for use to put together and we faced a number of technical challenges.

For new applications we highly recommend looking at Anvil and seeing if it fits. It can help in providing a simple portal environment in which to display and layout portlets. It also has menu system that allows for the user to choose which portlets to display.

InfoQ then asked Ryan to discuss Flex modules and how Anvil uses them:

This was one of the biggest lessons we learned from James, was how to work with Modules. We have tried to capture these best practices in Anvil by providing utilities to handle module loading and management. Breaking an application into modules provides a number of benefits, such as developers being able to work on isolate parts of the application. This is nice so you don't have to load the entire project into Flex Builder. Anvil also provides the ant scripts to easily compile flex applications. This combined with modules provides another benefit when compiling the entire application, modules allow the compilation to be threaded to speed up compile times.

When it comes to run time and deployment modules have another benefit. A small part of the application can be loaded at startup to provide a quick user response. Then other parts of the application can be loaded on demand in the background. In this way individual modules can be secured or even distributed to different machines for load balancing or fail-over.

Lastly, InfoQ asked Ryan what else our readers need to know:

Right now we are really looking for feedback from the community. We have a lot of ideas of where to take Anvil, but we want to make Anvil useful for a broader audience.  I discuss a number of them in a recent video interview I gave to DrunkOnSoftware.com.

Also I have recently joined Gorilla Logic (www.gorillalogic.com) and am looking at how we can incorporate there work on Flex Monkey  (http://code.google.com/p/flexmonkey).  We are looking at ways to test individual modules in Anvil using Flex Monkey.

Mostly though we would like ideas from the community of what the would find the most useful.

Thanks for your time, Ryan

To get started with Anvil use Ryan's tutorial, An Introduction to Anvil.

No comments

Watch Thread Reply

Educational Content

Collaboration: At the Extremities of Extreme

Jason Ayers share the observations he made watching a team of developers collaborating in real time on the same code base, pushing XP, pair programming and continuous integration to their extremes.

Yesod Web Framework

Michael Snoyman presents Yesod, a web framework written in Haskell and containing a web server, templating, ORM, libraries (templating, gravatar, etc.).

Transactions without Transactions

Richard Kreuter and Kyle Banker on how to avoid classical RDBMS transactional systems by using compensation mechanisms, transactional messaging or transactional procedures.

Attila Szegedi on JVM and GC Performance Tuning at Twitter

Attila Szegedi talks about performance tuning Java and Scala programs at Twitter: how to approach GC problems, the importance of asynchronous I/O, when to use MySQL/Cassandra/Redis, and much more.

10 tips on how to prevent business value risk

One category of risk that project teams need to ensure they address is business value failure – delivering a product that fails to provide value for the business investor.

Interview: Software Systems Architecture: Working With Stakeholders Using Viewpoints and Perspectives

InfoQ spoke to the authors of Software Systems Architecture on a couple of new topics, the System Context viewpoint and Agile, which have been added to the second edition.

Beauty Is in the Eye of the Beholder

Alex Papadimoulis discusses ugly code, where it comes from, how to avoid it, and how to get rid of it.

Architecting Visa for Massive Scale and Continuous Innovation

John Davies examines Visa’s architecture and shows how enterprises have architected complex integrations incorporating Hadoop, memcached, Ruby on Rails, and others to deliver innovative solutions.