Cairngorm is an application framework written by Iteration::Two for Macromedia Flex.
About the same time I started learning Flex, I started getting into learning ARP, a light-weight framework originally created for Flash. ARP has a lot in common Cairngorm. There was some contention between Aral, ARP’s creator, and Steven one of Cairngorm’s contributors on a few points.
One of which was ViewLocators/ViewHelpers. I tried for ages to get a frikin simple, 1 sentence description on what the hell they did. I had the same problem with Business Delegate. I fixed that by using a business delegate in a project, and seeing how they could help.
Aral had some notes in the ARP documentation about them ViewLocator/ViewHelpers, but they didn’t really give a lot of detail to why.
Steven responded to me personally, twice, as well as a couple times on public email lists and my blog; very long, and detailed responses.
I still didn’t get it.
Aral and Steven got into it on Flexcoders at one point, and Aral had a well formed counter-point.
I still didn’t get it.
I even asked my boss, Jeremy Bruck, a smart CTO. He gave me a 2 sentence answer, with an anology.
Still didn’t get it.
I downloaded the framework and read the docs, but really saw no point.
SO, I’m in the company office today because I needed to have some meetings with the boss and co-workers on a project I’m working on as well as a have one of their admins set my computer up with ColdFusion & friends. One of their developers, Dave Buhler, is using Cairngorm now in one of their projects.
I assualted him with questions, and he gives me a 1 sentence reply. I warp his words into a counter-quote, and he confirmed what I said as correct. HOLY SHIT, I GOT IT!
“A ViewHelper is a class that calls methods on whatever View it’s associated with. ViewLocator is a Singleton that stores all of your ViewHelpers by name, like ‘MyLoginFormViewHelper’”.
God, I should write a book; “Cairngorm for Flash Developers.” Suddenly it makes soo much sense as to why you would actually do that on a project that had a few team members with A LOT of views.
Steven, why in the hell didn’t you say that in the first place?
The jury is still out on how I feel about them, though. I’ve never had problems finding my views, nor calling methods on them; but that’s because it’s usually me, or me and 2 dudes that work with me, keeping in constant communication. I can see how if I had a lot of developers working on the same project where I was not in constant contact with them, and where there were a plethora of views where ViewHelpers and a ViewLocator would help.
I’ll battle test her in the next few weeks to see if I dig it or not.