The Cairngorm Microarchitecture is a lightweight yet prescriptive framework for rich Internet application (RIA) development. - from Adobe Lab’s Cairngorm PageI asked him a few questions about Flex, the pricing model, what is open-sourced, what is not, related open source projects, and the viability of JavaFX. Read more for the interview…
The Interview
Q: What is Cairngorm? Is it something that you would recommend?
Ward: Absolutely.
Ward: Caringorm is for large applications, medium to large applications, for Java developers and distributed teams it is “a must”. It allows you to take the core J2EE patterns that you are already used to using, you know, things like front controllers, commands, delegates, and value objects, and apply those to building front-end Flex applications. For Java developers, it’s very familiar to them, in the same way that they are used to doing it on the back-end but for the front-end.
Ward: Cairngorm allows you to have a clear definition of where pieces of code go. We’re using Cairngorm on the Meldware Email client it is built with Flex and so anyone can look at that codebase and automatically know things like: I’m looking at an email view.. oh, that’s problem in the email view class, or I want to look at the business logic for how you save a contact to the back end. Well, that’s in the save contact command class and there’s a contact delegate. You know so it’s very very important for building large application that multiple people are working on and great for Java developers because we can use the same patterns that we are already used to.
Q: What is your programming background?
Ward: I’ve been doing Java since about 97.
Q: From your own Java experience, would you compare Flex to a Servlet API for front-end development and Cairngorm to a framework that runs atop this “Servlet API”. Is Cairngorm similar to something like Struts?
Ward: Yeah, you could definitely look at it like that. So, there are micro-architectures that you could build without Cairngorm. The most basic thing you can do without Cairngorm is create a model locator class and put your model stuff in there, you could have your views that bind to your model. So, it is possible to have a nice separation between your view and your model locator without Cairngorm. Then, you can also have delegates or any type of business logic encapsulation tier and you get the three components talking to each other using the typical MVC paradigm. You can do all of that with Cairngorm as well. Cairngorm just gives you a defined way of: I put this here, I put this here, I put this here, that is familiar to Java developers.
Ward: You can do a more lightweight MVC without Cairngorm if you want to, and there are people doing that. I do that on smaller projects that I’m the only one working on.
Q: Is Cairngorm a good place for Java developers who are thinking of learning Flex and Apollo.
Ward: I don’t know if it’s a great place to start. I would start with the more basic concepts. You can do everything in a single file. I usually start there: do it in a single file first, and then break out the model into a separate class, then break out a delegate into a separate class. And, so being able to show them how to do MVC in a Flex application without using Cairngorm. Then you show them Cairngorm and it’s like “Aha!, now I see how this relates to the JEE patterns I already know, and I can see how to separate things using Cairngorm. I can see how a team would more effectively use Cairngorm to be able to work together.
Q: Red 5, is Red5 on Adobe’s radar, do you know about Red5?
Ward: Yeah, it’s a RTMP server, open source. We also have our own RTMP server that we sell.
Q: Is that the Flex Communication Server?
Ward: Flex Data Services, there is also what used to be the Flash Communication server now the Flash Media Server which also does RTMP. There are a bunch of different ways to get RTMP support in your application if you want it.
Q: Do you view Red5 as a threat?
Ward: No, no, I don’t think so, there are people that are fine with using something open source. There are other people that want Adobe backing a product They want Adobe support, they want the accountability and support, whatever is it, why they pay money for software, there are definitely a lot of people that are paying for the server software. But, there are definitely people using the open source tools as well.
Q: What’s the feedback from existing Flash developers on Flex. Flex seems like it is squarely aimed at developers.
Ward: It is definitely focused on developers. There’s a nice split between designers and developers in the Flash world. So designers will typically use the Flash authoring tool, the time-line based tool. Developers will typically use Flex and they can share assets back and forth so they can work together. But, now, since we’ve created Flex, we’ve allowed for that division of roles. It is a natural division of course, I’m a developer, I’m not very good at design, and most designers aren’t very good at writing code. When we released Flex it allowed us to have proper separation and that’s been a huge success, having those two products and allowing them to work together.
Q: People who do things like Jib Jab would use CS3, but developers would use Flex? And Cairngorm is a way to provide structure to both efforts?
Ward: Cairngorm is more about Flex. If someone creates a really slick component or something in the time-line tool you can export that as a SWF or a SWC and then use that within your Flex application, so it creates a nice reuse model a nice workflow between designers and developers.
Q: How much does it cost for an organization to deploy Flex on the server side?
Ward: The free SDK that we’ve announced we’re open sourcing, that’s free, so people can build applications. Lots of people are using that to build full-blown Flex applications that talk to a Java back-end or a .Net back-end, or PHP, or Ruby on Rails… whatever they want on the back-end. We have a server product called Flex Data Services that we do license for a single CPU.
Q: $10,000 a CPU?
Ward: It varies.
Q: You can launch a Flex based application tomorrow for nothing?
Ward: Absolutely, and a lot of people are.
Ward: I still find people that are confused about that, and the reason for that is because, in Flex 1.0 and 1.5, the only way to license Flex was per CPU on the server. And, some people found out about Flex back in that time frame and they haven’t yet realized that, with Flex 2.0, we’ve completely changed the model. We basically took everything that was Flex 1 and 1.5, took that whole programming model, and we rebuilt a lot of it, built it atop of Flash 9 for a lot of great performance benefits and a number of things, and now that’s the free SDK. Almost everything that was in that Flex 1.5 product that we charged per CPU became the free Flex SDK. And, we built a new product called Flex Data Services that has some additional functionality like data synchronization, real-time messaging, remoting, and we also built the plug-in for Eclipse. Those were two new products that came out that we charge for but the SDK, the thing that was licensed per CPU, became free.
Q: Respond to my FUD post from earlier this year, “Writing a Flex application more than 1000 lines becomes unwieldy…”
Ward: Like building any application, when you follow OO design priniciples and try to keep you classes small, the incremental compiler within Flex can do a lot better job at keeping compile time down and that also helps to make the code more maintainable. It takes time to learn. You know, when I first started writing a servlet, my servlet turned into a single class 3000 line servlet. And, eventually I learned how to use frameworks like Struts and I learned how to do better OO programming and do EJB and all those kinds of things. Things got more maintainable, my classes weren’t 3000 lines any more: better maintainability and better compile performance. The same exact thing applies to Flex.
Ward: I’ve written Flex applications that were a 1000 lines and were unwieldy, but that’s not how it has to be. You can create a good architecture. Cairngorm definitely helps you to create a good MVC architecture, it helps but it also takes time to learn those practices. And we probably need to do a better job of documenting those best practices and creating articles about how to create those good architectures up front so that pepole don’t get lost up front and create unwieldy applications.
Q: Speaking of documentation, I noticed that Flex ships with an impressive set of documentation the developer’s guide weighs in at 1900+ pages. How large is the documentation team?
Ward: Our total documentation pages for Flex 2 is over 5000 pages. My guess is 5 to 10 people. I don’t know for sure. If you count all the content on blogs… the Yahoo list is the premier support group, last time I checked there are 6000 people on the flex-coders list on Yahoo. Tons and tons of questions and answers on that, tons and tons of really smart people on that list, so you can get answers to your questions really quickly that way.
Q: Where are you based?
Ward: Live in Omaha, I’m on the road most of the time talking about Flex. Adobe is headquartered in San Jose, I’m out in San Francisco once a month. On the road almost every week. Sometimes with clients, I’ve been doing a JUG tour recently.
Q: How long will it take Sun’s JavaFX to catch up with Adobe Flex?
Ward: Depends on what you call the tool set because if you include the Flash authoring tool for designers…
Q: At JavaOne, Rich Green said that they were targeting graphic designers.
Ward: What? are those graphic designers going to be using NetBeans? And, they think they know the designer mind and can create a designer tool?

