On 4/25/07, Ian Skinner <[EMAIL PROTECTED]> wrote:

> So, one has managed to wade through all that exposition, what is a good
> way to do this?  Where do I put the data access logic.  I presume in my

You might want to read up on MVC:
<http://en.wikipedia.org/wiki/Model_view_controller>

> root application file.  But, if I do that, how do I access it from my
> various view pieces?  How do I connect all the dots?

Your view pieces ("components") shouldn't call your data access logic.
 Instead, they should fire (possibly custom) events when the user
"does something".  In your Main.mxml, or better yet in a "controller"
layer of ActionScript classes (see MVC, above), you will write code to
listen for these events and call the data access logic code, which
itself probably belongs in yet another separate layer of ActionScript
classes.

This process of factoring out your application into layers is called
architecture, and there's an infinite number of ways to do it.  When
people recognize a general pattern for doing this, they usually will
construct a framework to facilitate re-use and avoid repetition.  The
Cairngorm framework is an example of this.

e

Reply via email to