4 ms·
Why is this new in 2012? The "event" component is generally implemented using the Observer/Listener pattern in Java and has been done like so for yonks. The mos
by darylteo 13y ago
Why is this new in 2012? The "event" component is generally implemented using the Observer/Listener pattern in Java and has been done like so for yonks. The most "modern" concept he alludes to in that section is the idea of everything being modelled as operations (and sub-operations) which is pretty much Command-Query-Responsibility-Segregation.
This obviously is not convenient in terms of web facing applications. Don't forget that web pages are intrinsically static which means your model has no way of pushing events to your view. Unless we (in 2013) are suddenly advocating that every site now should be using WebSockets (Just as bad as using PostBacks in ASP WebForms... unless you are writing a client-side application)? And lets not forget that each web application endpoint (HTTP_METHOD + URL) is in itself already an intent/operation described here -> GET = Give Me Information. POST = Mutate Information.
In any case, MVC isn't fully dead as it has evolved into MV(C)VM instead. Instead of the View getting the data from the Model, the Controller gives the required information to the View.
- sklivvz1971 13y agoMaybe you mean "devolved". MVC is alive and kicking where I sit. Instead I constantly see the passing corpses of MVVM and CQRS projects... Honestly, not trolling - this is what I have seen for many years.
- darylteo 13y agoWell it depends on how people are using it I guess? ;) just because there are plenty of MVVM/cqrs projects that have failed doesn't mean that mvc is more successful... One could propose that devs are more familiar with the steward of traditional architecture? Pretty much all iOS projects are MVVM - See UITableView. AngularJS is arguably MVVM: in this case the views are databound to the view model which is held by the controller, which is essentially the "Events" component. Additional Edit: All MVC Java Swing apps could arguably be classified as MVVM -> all your JComponents are all... MVC! Which really leads me to think that MVVM is really just nested MVCs... perhaps =)
- sklivvz1971 13y agoWell, the problem is that if you find Controllers badly defined in MVC, good luck in understanding how to use View Models properly. MVVM seems to me on many levels a re-hash of the old Document/View concept, which is... not so good, because of coupling. And in fact, Many MVVM codebases end up being tightly coupled - bear in mind, also many MVC projects, especially of the ActiveRecord sort. My comment obviously relates to my experience, which is admittedly more webby than application-y. I thought iOS was inherently MVC though (or at least, that's what they claim)
- darylteo 13y agoI'd argue that MVVM is a subset of MVC. So technically they're accurate. And also, anything that is "badly done" becomes bad. I'm not really sure why it is hard to understand View Models... your controllers shouldn't define your view models. Your VIEWS determine what information is needed to render itself. Any templating engine that requires you to pass in a model (i.e. Handlebars, Jade etc.) is, in effect, MVVM. This makes your views more concise since it doesn't get access to a whole model when it isn't required. Its dependency is specifically only on the View Model itself.