I favour events.  I have just spent the weekend switching from a
(solely) central controller model to an event driven model and here's
why.  

Every time anything happened through a user gesture which changed the
state of something in the controller, every binding got updated (as
you would expect).  As my application became more complex this became
an increasing overhead and I found myself more and more susceptible to
timing issues (especially with lazily loaded server side data).  

I may have been doing something wrong but I had a few seconds of
binding update on some changes to central pieces of data.  It was only
getting worse too.

In addition I had liberal sprinklings of casts of parentApplication or
some such back reference throughout my code to bindable variables in
the central controller.
 
It just felt wrong to be hooking up my nicely objectified components
to some artefact of the circumstance in which they are being used. 
This is exactly the opposite way that the Java world is going with the
likes of Spring and once you have reaped the benefits of that approach
it is very hard to go back.  

I suppose I have a philosophical objection to doing that so part of my
re-architecture was to remove a lot of these implementation
dependencies and a nice corollary (which I think justifies my weekend
working) is that I now have less code overall, some re-usable
libraries and a faster app.

I'm not saying that flex/AS in and of itself causes these problems but
it is easy to fall back on a central controller model and it is a bit
like having loads of global variables.  It gets you going in a hurry
but is not really sustainable.

That's my experience so far anyway.  

--- In flexcoders@yahoogroups.com, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> Many folks prefer a model/view or model/view/controller architecture and
> use databinding to hook up to a central model or controller.
> 
> ________________________________
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of stephen50232
> Sent: Saturday, March 31, 2007 5:08 AM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Accessing the parent component properties
> 
> 
> 
> Hi,
> 
> I have a system which I'm building using a series of components, all 
> called from within the Main.mxml file. What is the best method for 
> components to access the properties of the Main.mxml file. For example 
> if I change the state or amend the selected section of a viewstack?
> 
> Is it best to use events?
>


Reply via email to