Brett,

Events are actually an a pretty fundamental component of an MVC
implementation. Events are most often used by the model to notify the view
and/or controller of changes (Observer pattern).

If your model is responding to *any* events then its really not acting as a
model in the traditional MVC sense. Models should be "pure" data, they
should basically represent state and contain no behavior. The exception, of
course, are structural behaviors like collection management
(ArrayCollection) or notification (Bindable). If you have parts of your
model that are listening for events that's a good indicator (in my book)
that your model needs some refactoring to truly be MVC. I tend to work
toward the goal of the model having only properties, no methods.

Troy.


On 3/25/07, rumpleminzeflickr <[EMAIL PROTECTED]> wrote:

  Hi there,

I'm building a flex app using MVS and it seems to me events can break
the MVC pattern?

I.e a event in the ui layer could trigger something directly in the
model etc..

Is it recommended to use Events in this way or am I being totally dumb
here.?

Any feedback appreciated..

Many thanks,

Brett

Reply via email to