Cairngorm Tech Guides - Call for Topics

| 25 Comments

So I have challenged the Adobe Consulting team with producing some technical guides around Cairngorm - short 2-4 page documents - that capture some of the approaches, techniques and ideas we have been implementing on projects worldwide, where we are building Rich Internet Applications with Cairngorm.

So many of the common questions aren't necessarily best responded to with more code, more interfaces, more abstractions and more framework classes, but are really questions about strategy and tactics.  Working with modules.  Strategies for internationalisationand localisation.  Working alongisde Flash Media Server. Cairngorm alongside data management services in LCDS.  Implementing a best-practice secure login.  Creating your first Cairngorm project.  How do you manage view-states.

So here's my question: if we were to write 10 technical guides around how we use Cairngorm, each guide not necessarily being code (or entirely code) but just sharing with you the techniques, tradeoffs and considerations we have passed from project to project, what would those topics be ?  They may be the simplest of topics "how do I create a Cairngorm project from scratch", topics around using Cairngorm within your delivery approach ("what strategies are there for improving unit-test coverage in Cairngorm projects") to the downright advanced ("how do I pronounce Cairngorm ?").

I'd welcome community feedback; I'll collate a list of topics, and then we'll see if we can't let the community vote on the first technical guides that we'll produce.

I look forward to your input.

25 Comments

Hi Steven,

here are some ideas:
- how to switch easily between different implementations of business delegates in a command? For instance, I want to switch my UserRemoteObjectDelegate to a UserWebserviceDelegate or a UserMockDelegate for testing.
- how to handle concurrency? Scenario: several connected clients, 1 central data source. How do you synchronize data? Polling, pub/sub, etc (I find this the hardest one to design and implement properly and would really appreciate some insights)
- how to implement a true Domain Model with business logic integrated in the entities on the client. What strategies would you recommend for mapping DTO's to Domain objects? (see Fowler, PoEAA - Assemblers)
- should Cairngorm use the term DTO instead of VO? I'm referring to publications from Eric Evans and Martin Fowler.

I'm alwaysinterested in more in-depth discussions.

regards,
Christophe

Great suggestions Christophe!

+1 to all of Christophe's except the request for DTO over VO. +100000 to that :).

* Delegates: I'd especially like to see something about how AC approaches it: I've been using abstract factory to wire Delegates to Commands, but I'd like to know what other approaches are taken.

* Concurrency and Domain Models: Esp. how state changes are synchronized in systems where DTOs are used at the business level but Domain objects are used in the rest of the system

Simple things would be nice. I'd like to learn caringorm but find it to be a steep learning curve. I usually start a project and start reading about it but then have to get the project finished before I'm done learning!

So somethings are:

1) Creating a project from scratch

2) Keeping class objects the same on the client and server...i think this is where caringorm shines but I'm not sure. So if I change an object in an AC on the client I want to update that on the server when it happens.

3) Can't these be videos? Videos are soo much cooler than documents. I always find that in documents the author always leaves out one little point that seems obvious to them but not so much to the lay-person. I would love to see people doing the two steps above in a camtasia video rather than a document.

-Nate

Here's a quick article on how I did Delegate factories with Christophe's Prana framework.

I would vote for...

1. Cairngorm and Unit testing...which means switching delegates for test purposes, creating a flex project or other to do the testing as well that works with continious integration

2. Concurrency...

3. BlazeDS and Cairngorm

It's taken me 6 months, but I've finally come to terms with all object-building code needing to be in the Delegates (for xml-based communications)... Maybe a document/video that shows object-building code in the Commands/VOs, then showing why that's a bad idea, and how to move it into the delegate (and how to abstract it out so that you can build it without having access to the model).

Scaffolding. I want to declare models, with just a token few attributes each, then push a button. I'm afraid Rails has pretty much ruined my willingness to build my own scaffolding.

This would fix my learning curve problem, as well as help push world+dog along the best-practices path.

I'd like to read about:

1. Using Cairngorm in an application that stores data to a local database.

2. Cairngorm and View States for advanced applications beyond the simple login or shopping applications.

3. Cairngorm and Modules

4. Cairngorm and BlazeDS

Thanks for asking!

Steven,

Sorry to bother you, but it appears that some pages on weblogs.macromedia are serving up the CFM source, rather than render:

http://weblogs.macromedia.com/pmartin/archives/2006/06/flexunit_ant.cfm

I wouldn't bother you, but your blog seems to be one of most recent updates, and pointing to weblogs site redirects to feeds.adobe...

-Scott

I'd like to know what your suggestions are for creating reusable libraries in Cairngorm.

For example, I have 2 different application projects, and both use the same value objects, and both have the same need to be able to retrieve the value objects and update the model. Should I put all VOs, delegates, and services into the common library, and then put all commands, the frontcontroller, and the modellocator into each application that uses the library?

Another idea might be to cover the use of Cairngorm framework within AIR applications. Using the command pattern to create undo-able operations, etc.

Best practices for maintaining a "session" (or at least some sense of trust of which authenticated user is submitting a request) with the back-end.

Hello Steven,

I add a vote to:
1.) Managing complex view states in a Cairngorm application
2.) How to notify views of asynchronous events
3.) Best practices for addressing the dichotomy between VO (better: DTO?) and the Domain Model

The idea with video sounds nice for more hands-on examples, workflow etc.
I like the style of David Coletta's screencasts, e.g.
http://www.colettas.org/?p=237

Anyway, great idea to share some of the knowledge!

Regards,
Daniel

1) Chaining several remote calls together in order (what happens if the middle one fails etc)
2) Which bits of the framework are over used (how can you make a simpler Cairngorm application)

How to use Cairngorm along with Maven while utilizing the modules features in Flex 3. It seems to me that the modules creates a problem for people using Maven as it conflicts with the one-artifact-per-project approach which Maven is built upon.

Outline the future of Cairngorm and what things you are looking at improving? Is the idea still to create tools for generating code or are you looking at ways of preventing developers from having to write code?

How to use Cairngorm when you need to make sequenced calls to different services. Are you using the horrible sequence command or do you build your own custom stuff for this?

Hi Steven,
keeping it simple it would be nice to offer a quick overview of structure of cairngorm pattern : delegate - service etc
in either video or diagram like:

http://www.appfoundation.com/blogs/giametta/wp-content/uploads/2007/04/cairngorm2_rpc_ui.png

then follow through an event call-> command-> delegate-> vo etc in a mini project (this would condense a quick start overview for newbies) and offer a small working example of code concentrating on one data call example

Good one, Steven. Great post.
A few that I often see "in the wild":
- How to properly use delegates and commands. What logic goes in the delegate vs command vs view (straight forward but very often misunderstood)
- How best to 'marry' application state (not necessarily mx:state) with browser's history management (memento? or no?)
-how to efficiently use cairngorm where you have modules used across multiple apps

I think there are some excellent suggestions here already. From my (selfish) perspective I'd love to see Cairngorm grow in popularity and in order to spread adoption I'd probably vote for a healthy dose of the entry level type articles. Here are some of the things I think could be covered a little better:

1. A simple cairngorm example using only HTTPServices. The cairngormstore examples I found when I was breaking into cairngorm were all built using WebServices that didn't quite work for me and it made it harder than it needed to be to understand services and delegates.

2. I've found it to be a little bit of a grey area how you should pass along data from events to commands to the model. Currently, I am sometimes using a parameter in the event constructor to pass along a VO (or a string or some sort of other data). I'm not sure if this is in accordance with best practices and it kinda makes me a little uneasy sometimes.

3. Regular events vs Cairngorm events. I think it would set some entry level coders at ease if they could see that they don't have to switch over to only using Cairngorm events but that they work together with other events.

I've had it in my system to put together a simplified cairngorm example and post my version of an entry level tutorial but have not gotten around to it yet. I think the need is definitely there though... and I'm very excited about having some new readings on Cairngorm but I'm not sure what I want in the advanced category... surprise me! :)

How to use Cairngrom when you have multiple flex projects e.g 3 Flex Application projects that share one more Flex library projects, that may have code-reuse among them

Cairngorm and BlazDS would be fantastic..

Already lots of interesting things have been covered. let's see if I can suggest something more...

- How to manage/communicate with views without the need of binding with the modellocator? ( sometimes is seems just too much. ).

- A resusable approach for chaining commands ( ...or a dynamic way to set nextCommand to the SequenceCommand subclasses ).

- This is not only cairngorm related, but it would be nice to see how you manage remote relational data and deep nested remote objects in a big application. Should VOs have nested objects in them? or just id's so you can recreate relations in the client?

Thanx for asking!!

Hi Steven,

I love cairngorm, but the development of cairngorm seems to have slowed down a lot. In the mean time other companies have succesfully extended cairngorm in a generic way. So my question is if you can take the time to look at the universal mind cairngorm extensions (flexcairngorm at google code). Some features really should make it in the general framework.

A summary of the problems/questions I have with/about cairngorm are:
* how to do view notification after a asynchonous call has completed without the use of the deprecated viewhelpers?
* how to do some sort of chaining cairngorm events in a sequential way? (the woking would be: one event fires after the previous event fired AND it's associated asynchronous call has finished and updated the model). If i can work this way with cairngorm, commands are simply always independend of each other. This would remove the need for sequence commands.
* modules integration in a flexible way
* externally configuring services in a cairngorm application so we can test easily with fake data or a different backend (testing/staging/production).
* best practices unit testing in a cairngorm application
* how to deal with conversion in delegates (for example xml conversion to a VO before the command gets the data)
* all commands have access to the model. what are good strategies to keep the model wel organized (multiple models? submodels? for example do you reccomend for example a usersManager with methods addUser etc in the modellocator, or just an arraycollection of users and keep the model dumb?) and how to make sure its integrity is always ok?
* best way to handle session information? (credentials etc.)
* is there a way we can make models read only for views and r/w for commands? It would be nice if we could enforce in such way that the views indeed ony read data from the model.
* general information on best practices in cairngorm development
* cairngorm in a large scale application.
* do you use modellocator everywhere in the view? or is it advisable to inject a part of the model into a view. for example
viewX model="{ModelLocator.getInstance().subModel}"
in the view itself we have a bindable var model of which the properties can be bound to inner components of the viewX.

any article on any of the points mentioned above would be very nice!

thanx!

Arnoud Bos

Hello there,

My vote would go to :

- Secure login/session management.
- One command/multiple server calls.
- Concurency.
- How to manage big projects (with 100 class in one package it's not really managable from my pov).
- Air strategy for data synchronisation would be really interesting too.

Hope that help.

Mega Ditto on all the suggestions above. I would add one topic based on market demand. I suspect this will be seen as sacrilege but what about Cairngorm as the Application Framework on the server side for other View technologies? Please don't stop reading just yet. We love Flex/Flash but there is a huge demand for applications that have GUI interfaces on many different devices, one of the latest hot markets is the Apple iPhone and alas it does not YET support Flash. So how do we build our browser based applications using Flex and Cairngorm and build Apple iPhone widgets that use the same business logic?

Ollie

Leave a comment

About this Entry

This page contains a single entry by Steven Webster published on May 27, 2008 3:20 PM.

User Experience - As simple as possible but no simpler. was the previous entry in this blog.

Adobe Consulting at Scotch on the Rocks is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.