Page 1 of 1
Node.js, MongoDB, MVC, MVM, Meteor...
Posted: Sun Jul 14, 2013 10:52 pm
by Verahta
I feel like this blog post has useful information, but I don't really understand what he means. Can somebody translate a summary of this article... For Dummies?
http://newcome.wordpress.com/2012/04/14 ... c-its-mvm/
Re: Node.js, MongoDB, MVC, MVM, Meteor...
Posted: Sun Jul 14, 2013 11:38 pm
by Jackolantern
He is basically saying that the Meteor framework (which is built on top of Node.js) is a game-changer in the same way that Ruby on Rails was for introducing MVC to web development.
Some of the article I don't completely get because I am not too familiar with Meteor (I have only read the high-level feature lists and a couple of articles, but was scared away by how fast it is developing currently), but I definitely see his issues with Node and even Express (a quasi-MVC framework for node). I have been building my application in node and socket.io as a single-page application with no client-side framework, and I am feeling some of the pains he is talking about.
Maybe some definitions would help:
Node.JS: You probably know this one. It is an asynchronous, event-based JS execution engine that has been the basis for many major projects lately, such as Express, Socket.io and now Meteor.
MongoDB: A very popular NoSQL database. Instead of dividing your data up into relational tables and querying for them, you store all your data related to one thing in your app as a Javascript object directly into the data store. I love MongoDB!
MVC: Model-View-Contoller. This is a pattern that Ruby on Rails popularized for web development. A web request comes in and hits a Controller, which determines how to route the request. It then uses a Model, which the data is all grouped into to create a data set for the request, and then it uses a View to assemble it all into an HTML page for the user. MVC went a long way towards making web applications more maintainable and manageable since before MVC, everything was just dumped into the same file on a page-by-page basis.
MVM: Model-View-Mapper? Not too familiar with this one, but it seems it is a newer pattern (or really a back-pattern, aka a pattern made after the fact to describe something already in the wild) to more accurately describe client-side "MVC" frameworks, which really aren't true MVC usually. These are designed to make single-page-applications (SPAs) easier to make and to provide more structure (something I am really feeling the pain of right now for not using).
Meteor: This is a very new node framework that is under heavy development, but it is already getting the attention of tons of people. It is trying to solve the problem mentioned in the article about having state represented both on the server and on the client when you are actually using the same language in both places (Javascript). It just seemed like there had to be a more elegant solution, and Meteor is trying to provide that. It provides live, automatic updating from the server to the client. I am going to be keeping an eye on Meteor

Re: Node.js, MongoDB, MVC, MVM, Meteor...
Posted: Sun Jul 14, 2013 11:47 pm
by Verahta
Thank you Jack, that was a very helpful breakdown, I appreciate it. Think I am going to add MVC to my learning agenda, as I plan for my game to "live update" pieces of the page without having to reload the entire page.
Re: Node.js, MongoDB, MVC, MVM, Meteor...
Posted: Sun Jul 14, 2013 11:52 pm
by Jackolantern
MVC alone won't help you with that, as typical MVC frameworks (CodeIgniter, Symfony, Zend, etc.) are all 100% server-side. Although I believe everyone doing server-side development work should learn an MVC framework since it makes things so much more structured. But to update parts of the page without reloading the whole page, you can do that with AJAX.
Re: Node.js, MongoDB, MVC, MVM, Meteor...
Posted: Mon Jul 15, 2013 8:18 pm
by Verahta
AJAX alone, or AJAX in conjunction with Jquery/Javascript?
Re: Node.js, MongoDB, MVC, MVM, Meteor...
Posted: Tue Jul 16, 2013 1:17 am
by Jackolantern
AJAX is a Javascript technique, not a stand-alone technology. So you at least need regular Javascript to use AJAX, but jQuery sure makes JS simpler, all around.
Re: Node.js, MongoDB, MVC, MVM, Meteor...
Posted: Tue Jul 16, 2013 2:40 am
by hallsofvallhalla
Jquery ajax is far easier.
Re: Node.js, MongoDB, MVC, MVM, Meteor...
Posted: Tue Jul 16, 2013 2:44 am
by Jackolantern
It really is. A full, complete AJAX call with full error detection and callbacks is around..what...80 - 100 lines of code in vanilla JS. With jQuery you can do it in around 5 lines.
Re: Node.js, MongoDB, MVC, MVM, Meteor...
Posted: Tue Jul 16, 2013 2:52 am
by hallsofvallhalla
yep.
Re: Node.js, MongoDB, MVC, MVM, Meteor...
Posted: Tue Jul 16, 2013 3:52 am
by Verahta
whoa... That sounds awesome.