Hi Guys,
Cairngorm is
purposefully non-prescriptive about the way you choose to implement the view; so
we would neither advocate that you do so using States, nor advocate that you
don't. This is one of our core-values
in being able to call ourselves a "lightweight architecture" - that we are not
enforcing upon developers the way they structure their MXML that implements the
overall user-experience.
Typically to date, we (iteration::two / Adobe Consulting EMEA) haven't
leveraged States for multi-screen
Cairngorm applications, preferring instead to use States where we have transitions within a complex MXML
component (which can live both within and outwith a Cairngorm application -
components shouldn't depend upon Cairngorm to be reusable).
When you are building applicaitons with a number of
different views, the decisions that you make to structure these applications are
irrespective of the fact that you are or are not using Cairngorm. I could
certainly advocate best-practices in doing so - and will try and do so in a blog
entry or other post - but don't be mistaken because you are using Cairngorm that
there is a prescribed way for building applications with multiple or large
numbers of views. In the end, the patterns are repeatable - whether you
have 1 view or 100 views bound to a model locator class, and whether you have 1
view or 100 views that are responsible in some way for notifying the controller
of a user-gesture by broadcasting an event. Make sense
?
I can't recall if my presentation from MAX2005 is archived
online or not - but if it is, I covered this idea of architecting the view in
that presentation; come to think of it, the structure of that presentation was
the basis for the 6-part article on devnet, which you can find linked on www.adobe.com/go/cairngorm/
So you're free to build your view however you like - and
leverage whatever best practices the community has to offer you.
Cairngorm will form the bedrock (*) of your underlying
application whatever decisions you make.
Best,
Steven
(*) Subtle Cairngorm pun in there...
Steven WebsterPractice Leader (Rich
Internet Applications)Adobe ConsultingWestpoint, 4 Redheughs
Rigg, South Gyle, Edinburgh, EH12 9DQ, UKp: +44 (0) 131 338
6108
m: +44 (0) 7917 428 947 [EMAIL PROTECTED]
From: flexcoders@yahoogroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of Mike
BrittonSent: 30 July 2006 21:30To:
flexcoders@yahoogroups.comSubject: Re: [flexcoders] Cairngorm -
Invoking screens
Building a larger application involves a combination of view statesand
MXML components. Take JesterXL's Amazon search example:http://www.jessewarden.com/archives/2006/07/flex_2_webservice.htmlIn
this example, you can see the use of view states. This is how
many"screens" can be combined into one. I definitely suggest you look
atStates in the Flex help.In the same example, a modal window is
used to show debugging info.The same technique can load in forms in the
form of MXML components.You can have a directory of forms, each one
something like this:?>showCloseButton="true"
close="PopUpManager.removePopUp(this);"creationComplete="initApp();"xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute">"top" width="100%"
height="100%"verticalGap="10" paddingBottom="5"
paddingLeft="5" paddingRight="5"paddingTop="5" x="4"
y="4">/>/>>http://www.epicenterconsulting.com"width="100%"/>/>[EMAIL PROTECTED]ulting.com"
width="100%"/>Then
you can invoke this window from your main.mxml:private function
showModalWindow():void {myModal =
TitleWindow(PopUpManager.createPopUp(this, windowView,
true));myModal.width = 440;myModal.height = 465;myModal.x =
0;myModal.y = 0;myModal.addEventListener("mouseDownOutside",
enableAll);}Combine this technique with States and a TabNavigator
and you have alot of room to build a large app. I'm in the same boat as
you,learning Cairngorm by examples and by reading the list
andexperimenting. The learning curve is fairly steep, and without
thehelp of examples, putting the pieces together can be a slow
process.You aren't alone, but it can feel like it sometimes. As I learn
newstuff I'll be sure to post tutes on my blog for people to check
out.I also recommend checking all the examples at Adobe -- Mike
Potter's,etc -- they are extremely helpful.hth,Mike
Britton
__._,_.___
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/fil