Re:Maria: An MVC framework for JS
by nicklovescode on Saturday July 07, 2012 @11:29PM
(#4213487)
I'm curious
What are patterns you mentioned?
Re:Maria: An MVC framework for JS
by ericingram on Saturday July 07, 2012 @11:56PM
(#4213557)
Perhaps the most significant new pattern is that domain models communicate with a REST interface to the views. Usually you justify procedural coupling when writing controllers that interact with models, and it seems to make sense because controllers and models are often written in similar style and syntax. But still, it caused me a lot of pain in the past.
So now, the models only expose a REST API beyond the "class wall" (so to speak), which feels rather natural when called from views in template syntax. Client-side frameworks do it this way already, but I'm talking server side.
A great side effect of models speaking REST natively is, it becomes trivial to create a public API, just add authentication.
There's a few other things, like automatic request view routing.
For almost a year I have been writing web apps with no controllers, and it feels right. So far so good. It simplifies routing and a couple other things.
That's not to say you can take the avg MVC framework and drop the controller. A couple new patterns were really important to keep things sane. For example, there is still technically a default controller that does the default request handling for views. Happy to share more if anyone is curious.