O'Reilly logo

Professional Cairngorm™ by Jeremy Wischusen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

25.4. I Have To Write How Many Classes To Do That?

I am sure you have noticed from the sample application that doing anything in Cairngorm requires writing several classes. Even the simple features that you created for the sample project required 61 classes using the one-to-one paradigm. You were able to get this down to about 50 classes by combining events and delegates. Regardless of how you are handling events and delegates, as the number of features grows so does the number of classes.

Most programmers are familiar with the "Hello World" application. There is a Cairngorm version of it at http://www.asfusion.com/assets/content/exampleFiles/flex/helloworld_cairngorm/srcview/index.html. This entire application could be done in a few lines of standard Flex code, but it takes eight Cairngorm classes and views to accomplish.

Ending up with several classes to do even something as simple as saying "Hello World" is not unusual in an architectural framework. The same criticism regarding class overload is often leveled at PureMVC.

Remember that the goal of an architectural framework is to provide a defined way of building an application, often to facilitate team development, not to end up with the fewest possible lines of code and classes.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required