Hi Chris...
Well, I guess it's becouse I'm more used to client-side MVC implementations (read Flash Platform).
On my current flash project for example, I'm using a MVC library that works like this:
Views broadcast events to the Controller. The Controller does the associated action, which in turn can directly access the view via a reference or update the Model. The Model gets updated and then broadcast onChange event to all the Views that registered as listeners.
In sum, when you update the Model, all the views that listen (are registered) to this model, get notified and can do whatever they want with the new data :)
>A Model returns you data in a format you need
>A controller gets data from a model and passes it to a view
>A view displays the data that's been passed to it.
>A controller gets data from a model and passes it to a view
>A view displays the data that's been passed to it.
Yep, there's a concept difference here. The MVC model I use on my flash app, the model acts just as a data holder. The server data is obtained via commands (command pattern) and stored on the model which notifies the views.
FYI, if you also work on Flash, I'm using Pixlib's MVC implementation using the FrontController strategy.
I guess nor implementation is wrong, it's just a matter of taste and enviroment... in the end, both are very valid MVC's implementations. There's isn't such thing as a universal all-mighty MVC implemenation I guess...
Cheers,
Marcelo.
On 10/6/06, Chris Hartjes <[EMAIL PROTECTED]> wrote:
On 10/6/06, Marcelo de Moraes Serpa <[EMAIL PROTECTED]> wrote:
> From what I can see, the main purpose of Cake's MVC is to separate things,
> but you can't for example register Views on a model and the model doesn't
> automatically notifies the Views.
>
I don't understand what you mean by "you can't for example register
Views on a model." Why would you want a view to modify your model?
That violates all sorts of rules about coupling code and defeats the
whole purpose of MVC in my opinion.
A Model returns you data in a format you need
A controller gets data from a model and passes it to a view
A view displays the data that's been passed to it.
"Registering" is a concept I have not heard of and would like an
explanation as to better understand it. Why would you want a model
to notify a view about something? Obviously, there is some concept
here I'm not aware of.
--
Chris Hartjes
"The greatest inefficiencies come from solving problems you will never have."
-- Rasmus Lerdorf
@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---
- Re: About Cake's MVC model Trevor Burton
- Re: About Cake's MVC model Chris Hartjes
- Re: About Cake's MVC model Marcelo de Moraes Serpa
- Re: About Cake's MVC model nate
- Re: About Cake's MVC model Marcelo de Moraes Serpa
- Re: About Cake's MVC model Trevor Burton
