Hi List,

Ok, this may sound a bit odd coming from someone who's been coding with MVC
for the last 7 years, but I seem to be missing the point of a Controller...
I'm hoping to start a discussion to help me (and maybe others like me)
improve my architecture by better understanding the Controller, and what
good that does...

First of all, here's a quick summary of my current architecture: All my
projects are based on an MVC structure in their core, but my Controller
class has only one function - linking the Model/s with the Views/s. The
communication between Model/s and View/s happens via Broadcaster - my own
AS3  reworking of the old AsBroadcaster (remember "broadcastMessage"? I even
found a way to get and set public properties in the model using
broadcastMessage("get", "prop")). Typically, the model notifies the View
that data was loaded, and then the View does all the donkey work, and calls
a number of generic methods on the model, mostly for data retrieval. 

Within the View, I use EventDispatcher for the usual stuff, like button
functionality.  The View classes are the ones that listen to the events. For
example, a View class may have a submit button, and that button's
MouseEvent.CLICK goes to a clickListener method in the same class.   If I
understand recent list discussions correctly, it would be better to move
EventDispatcher listeners to the Controller. Is that the correct approach?
If so, why...? 

When I coded my Controller class, I built into it the ability to link
Controller Classes with Broadcaster, as well as Views and Models, but so far
I haven't seen a good way of implementing it, or even extending the base
Controller class,  because everything in my code seems to be happening
either in the View or the Model layers. So where am I going wrong?

Please understand that I don't mean to say that the Controller is no good
other than as a way to link the View with the Model,  I'm just trying to
understand it better - there's always plenty of room for improvement!

Thanks,
Karina


_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to