« User Experience - As simple as possible but no simpler. | Main | Adobe Consulting at Scotch on the Rocks »
May 27, 2008
Cairngorm Tech Guides - Call for Topics
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.
Posted by swebster at May 27, 2008 03:20 PM
Trackback Pings
TrackBack URL for this entry:
http://weblogs.macromedia.com/mtadmin/mt-tb.cgi/9382
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
Posted by: Christophe Herreman at May 27, 2008 02:42 PM
Great suggestions Christophe!
Posted by: Steven Webster at May 27, 2008 03:14 PM
+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
Posted by: Joe Rinehart at May 27, 2008 03:40 PM
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
Posted by: Nate at May 27, 2008 04:42 PM
Here's a quick article on how I did Delegate factories with Christophe's Prana framework.
Posted by: Tony Hillerson at May 27, 2008 04:44 PM
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
Posted by: Mark at May 27, 2008 05:03 PM
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).
Posted by: Dusty at May 27, 2008 06:08 PM
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.
Posted by: Matthew Platte at May 27, 2008 06:40 PM
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!
Posted by: Dustin at May 27, 2008 07:15 PM
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
Posted by: scott at May 27, 2008 07:45 PM
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?
Posted by: Harry B. Garland at May 27, 2008 07:53 PM
Another idea might be to cover the use of Cairngorm framework within AIR applications. Using the command pattern to create undo-able operations, etc.
Posted by: Fred at May 27, 2008 07:59 PM
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.
Posted by: Hans at May 27, 2008 09:06 PM
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
Posted by: Daniel at May 28, 2008 12:57 AM
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)
Posted by: Tom Chiverton at May 28, 2008 01:49 PM
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?
Posted by: leif at May 28, 2008 02:46 PM
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
Posted by: lorraine at May 28, 2008 02:52 PM
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
Posted by: ekz at May 28, 2008 07:30 PM
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! :)
Posted by: Arni Maack at May 30, 2008 05:15 AM
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
Posted by: anon at June 3, 2008 02:16 PM
Cairngorm and BlazDS would be fantastic..
Posted by: geoffrey dhuyvetters at June 4, 2008 01:28 PM
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!!
Posted by: Joan Garnet at June 8, 2008 10:14 AM
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
Posted by: Arnoud Bos at June 13, 2008 03:02 PM
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.
Posted by: Nicolas at June 30, 2008 01:53 PM
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
Posted by: Michael Oliver at August 2, 2008 03:27 PM
