{"id":2691,"date":"2013-09-16T05:58:30","date_gmt":"2013-09-16T05:58:30","guid":{"rendered":"http:\/\/13.52.125.237\/?p=2691"},"modified":"2015-03-23T17:09:51","modified_gmt":"2015-03-23T17:09:51","slug":"opinions-forming-on-rails-more-on-node-js","status":"publish","type":"post","link":"https:\/\/sotaenterprises.com\/?p=2691","title":{"rendered":"Opinions Forming on Rails &#8211; More on Node.js"},"content":{"rendered":"<p>I have an opinion forming about <b>Rails<\/b>.\u00a0 It does seem to handle everything, but <b>Rails<\/b> is making the hair on the back of my neck stand up.<\/p>\n<p>If one could compare <b>Grails<\/b> to a <b>carrier battle group<\/b>, <b>Rails<\/b> might be seen as a <b>rickety<\/b> <b>pirate ship. \u00a0<\/b>\u00a0Although <b>Ruby<\/b>\u00a0(the language) is fine, <b>Rails<\/b> seems clunky, somewhat dated.\u00a0 It reminds me of Oracle: cumbersome install, heavy reliance on command line.\u00a0 It took quite a bit of set up to get through the tutorial.\u00a0 I had to assign very specific version numbers to all of the <b>gems<\/b> (plugins) in order to get through the tutorial as written. \u00a0That bothered me.<\/p>\n<p>Moreover, the <b>Rails<\/b> stack is a little scary because there is so much magic going on.\u00a0 I\u2019m sure it works great on the happy path, but what if you have to stray?\u00a0 Also <b>Ruby on Rails<\/b> feels like a cult.\u00a0 Rates for <b>Rails<\/b> developers are high.\u00a0 The phrase <i>The Ruby Way<\/i> makes my skin crawl.\u00a0 My wild-wolf instincts say <i>run<\/i>.<\/p>\n<p>I\u2019m of the opinion that model-driven design and MVC will save money if done right.\u00a0 This is evidenced by the fact that many popular frameworks revolve around a domain model. \u00a0Although all of the full-stack frameworks claim to conform to MVC (or MVVM), they appear to have different ideas about what this means.<\/p>\n<p><a href=\"http:\/\/sotaenterprises.com\/wp-content\/uploads\/2013\/09\/AbsoluteMVC1.png\"><img loading=\"lazy\" class=\"aligncenter size-full wp-image-2693\" src=\"http:\/\/sotaenterprises.com\/wp-content\/uploads\/2013\/09\/AbsoluteMVC1.png\" alt=\"AbsoluteMVC\" width=\"799\" height=\"276\" srcset=\"https:\/\/sotaenterprises.com\/wp-content\/uploads\/2013\/09\/AbsoluteMVC1.png 799w, https:\/\/sotaenterprises.com\/wp-content\/uploads\/2013\/09\/AbsoluteMVC1-300x103.png 300w, https:\/\/sotaenterprises.com\/wp-content\/uploads\/2013\/09\/AbsoluteMVC1-450x155.png 450w\" sizes=\"(max-width: 799px) 100vw, 799px\" \/><\/a><\/p>\n<p>This diagram depicts a pattern that I call <em>Absolute MVC, <\/em>a phrase we\u00a0coined at Corticon. \u00a0 A user action, such as inserting a new row into a table, triggers a message to the <i>model authority<\/i> in the back end. \u00a0The model authority knows how to change the model correctly in response to the user action. \u00a0A\u00a0single message may result in substantial changes to the model in a transactional manner.<\/p>\n<p>Full-stack frameworks often refer to the combination of the view authority plus\u00a0the model authority as a <i>controller<\/i>.<\/p>\n<p>In Absolute MVC, we formally separate the model authority from the view authority. \u00a0The view authority is concerned only with refreshing the view, and only in response to state-change notifications from the model authority.<\/p>\n<p>Unfortunately, the full-stack frameworks don&#8217;t actually work like this, notwithstanding that they claim to implement MVC. \u00a0 The key reason is technical, and it boils down to this: there was no convenient way for the browser to receive an asynchronous notification from the back end. \u00a0In other words, there was no reliable way for the model authority to notify the view authority that the model state had been changed. \u00a0Until now.<\/p>\n<p>As of this writing, there<em> is<\/em> standardized way to do this called Websockets (RFC 6455). \u00a0Moreover, there is a cutting-edge framework called <em>Meteor<\/em>\u00a0(which works with Node.js) that takes advantage of this new capability. \u00a0Meteor is the first (and only) framework that I have encountered that implements Absolute MVC with the browser.<\/p>\n<p>If you&#8217;re used to traditional web development (e.g., PHP, JSP, ASP), you have to see Meteor with your own eyes, but consider this. \u00a0The browser views are bound to a shared data model. \u00a0If any user changes the data model, all browsers update instantly. \u00a0There is no polling. \u00a0The function is driven by an asynchronous message from the server to the browser(s).<\/p>\n<p>Meteor maintains an object cache in the browser that is synchronized with the Node.js server. \u00a0All of this is transparent to the developer, who can behave as if all of the information is stored locally. \u00a0The system allows the developer the illusion of being able to directly access data inside MongoDB from client-side JavaScript.<\/p>\n<p>This architecture avoids a lot of the clumsy implementation issues that surround the traditional request\/response\/redirect patterns that plague JSP and the like. \u00a0The code to access data is simple, and you have to see the Meteor screen cast to fully appreciate this. \u00a0The server delivers <em>data<\/em> to the front end, and HTML rendering is done in the browser.<\/p>\n<p>However, one drawback to consider is that Meteor and Node.js are new, and many subsystems are still in their zero (beta) releases. \u00a0The good news is that Meteor apparently had a recent injection of financing which should keep them around for a while.<\/p>\n<p>It is no exaggeration to say that Node.js combined with something like Meteor could become popular very quickly, because the potential savings are enormous.<\/p>\n<p>I\u2019m currently working on a \u201cspike\u201d to get a <b>Hello World<\/b> application up on this stack to see it with my own eyes, and I&#8217;ll post my findings here.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have an opinion forming about Rails.\u00a0 It does seem to handle everything, but Rails is making the hair on the back of my neck stand up. If one could compare Grails to a carrier battle group, Rails might be seen as a rickety pirate ship. \u00a0\u00a0Although Ruby\u00a0(the language) is fine, Rails seems clunky, somewhat [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0},"categories":[1],"tags":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/sotaenterprises.com\/index.php?rest_route=\/wp\/v2\/posts\/2691"}],"collection":[{"href":"https:\/\/sotaenterprises.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sotaenterprises.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sotaenterprises.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sotaenterprises.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2691"}],"version-history":[{"count":5,"href":"https:\/\/sotaenterprises.com\/index.php?rest_route=\/wp\/v2\/posts\/2691\/revisions"}],"predecessor-version":[{"id":2834,"href":"https:\/\/sotaenterprises.com\/index.php?rest_route=\/wp\/v2\/posts\/2691\/revisions\/2834"}],"wp:attachment":[{"href":"https:\/\/sotaenterprises.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2691"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sotaenterprises.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2691"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sotaenterprises.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2691"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}