Welcome!

Java IoT Authors: Stackify Blog, APM Blog, Liz McMillan, Elizabeth White, Yeshim Deniz

Related Topics: @ThingsExpo, Java IoT, Microservices Expo, Linux Containers, Open Source Cloud, Containers Expo Blog, @CloudExpo

@ThingsExpo: Blog Feed Post

Node.js MVC Frameworks | @ThingsExpo #IoT #DevOps #Microservices

Modern JavaScript frameworks take advantage of programming principles that have long been part of other languages

A Practical Guide to Popular Node.js MVC Frameworks
By Omed Habib

Using any programming framework to the fullest extent possible first requires an understanding of advanced software architecture concepts. While writing a little client-side JavaScript does not necessarily require as much consideration when designing a scalable software architecture, the evolution of tools like Node.js means that you could be facing large code bases that must be easy to maintain.

Modern JavaScript frameworks take advantage of programming principles that have long been part of other languages, including software architecture patterns like model-view-controller. The value of work with frameworks that come with a pattern like MVC baked in is that the framework will do much of the work of managing the interactions between different sections of your code. You can write just the code you need for your particular application, such as code controlling what data the application outputs while the framework handles connecting that component of your application to the component that accepts and translates input.

JavaScript offers a benefit to working with these sorts of architectural patterns: because Node.js allows you to run JavaScript on your server, as well as on the client side, you can maintain a pattern like model-view-controller across your entire application.

MVC: The Software Architecture Pattern You Need to Know
The model-view-controller pattern of designing software (also known as MVC) was one of the first architectural design-patterns based on the responsibilities of its component software constructs. Trygve Reenskaug introduced the concept of MVC while visiting Xerox Parc (the same research facility that pioneered everything from GUIs to laser printers) in the 1970s.

MVC was revolutionary then and is still a key concept when discussing how to create new software. When using an MVC pattern, you can lay out the solution to any problem you expect to solve with the software you intend to build. The three components included by name in the pattern are:

  • The model, which describes the behavior of the application regarding data, logic, and rules

  • The view, which includes any information that the application may output (from tabular data to representations)

  • And the controller, which accepts and translates input

Note that the model, which is the core component on which you will wind up focusing, is independent of any user interface you are planning to create eventually.

In addition to these three elements, the MVC model sets out the interactions you’ll see between the components.

  • The model will store any data that is displayed in the view and stores data that the controller instructs the model to retrieve

  • The view generates an output based on changes to the model

  • The controller updates the model’s state and can also update the view’s presentation of the model

When using the MVC pattern to design software, you need to consider both the components and the interactions.

JavaScript Puts the View in MVC
JavaScript frameworks primarily improve your ability to write code for your users’ browsers. These frameworks consist of client-side code that you may consider to be most closely tied to view components (including any information your application may output).

Ember, Angular, Backbone, and React all excel at controlling view components. Some of these frameworks, such as Ember and Backbone, can also handle some elements of the controller — they can send instructions back to the code on the server and update it.

Provided you are focusing primarily on the browser, these four frameworks are likely to be your best options.

  1. Ember.js: This web application framework offers a straightforward feature set that will work for most projects. It may be the most friendly for a programmer coming from another language, such as Python or Ruby, especially for a developer used to using the MVC pattern. However, what may be the biggest deciding factor, Ember.js provides high application performance.

  1. AngularJS: The community working around AngularJS is incredibly active, making it a good option just by virtue of the tutorials, plugins, and other community-generated tools now available. That community is augmented by Google’s backing, helping AngularJS be a real contender among JavaScript frameworks.

  1. Backbone.js: One of the main advantages offered by this framework is its relatively small size though it gains that size at the expense of individual features. However, even with adding additional tools to the mix, Backbone.js tends to offer some of the best page load times. The result is a lean, minimalist framework that’s easy to learn.

  1. React: Facebook open-sourced one of their JavaScript libraries as the basis for React and have continued to add to it. The result is a high-performance library. It is a little less full-featured than the frameworks above, but as the React website describes, “lots of people use React as the V in MVC.” The community around React is growing, due to the upcoming release of AngularJS 2.0, which will not be backwards compatible.

For the most part, other JavaScript frameworks are not even in the same class as these four — many just aren’t well-maintained enough to rely on. Deciding between these four can be tough, given that they do offer many similar features. However, considering the communities and resources around each framework may help you come to a conclusion without having to rewrite your web applications four times over.

Node.js Tackles Model and Controller
While Node.js cannot be compared to most JavaScript front end or browser frameworks, it is excluded only because Node.js is really in a league of its own — Node.js is a cross-platform runtime environment, instead of a framework and is meant for use on the server. Node.js represents a bit of a revolution: where once you might only see JavaScript in client-side code (like with any of the JavaScript frameworks above), you can now use JavaScript across both your server and client code bases. You can create a web application entirely in JavaScript, where you previously would have needed both JavaScript and another language, such as Python or Ruby. Since its creation in 2009 by Ryan Dahl and other developers then working at Joyent, Node.js has seen adoption by companies ranging from IBM to Groupon. Both enterprise-level organizations and startups love the flexibility of using JavaScript to build scalable, web-based applications.

With Node.js, a programmer can use JavaScript across all three components of the MVC. Your model may run on your server, and your view may run in the browser, but they can both be written in JavaScript. Just that level of simplification may have guaranteed the rise of Node.js

Node.js’s rapid adoption rate created a boom in related tools. The number of Node.js frameworks you might consider working with seems to grow longer every day. The right frameworks can dramatically improve the process of building a new web application, especially if you are sticking with a well-established design pattern like MVC. These five Node.js frameworks are among the best currently available:

  1. Express: This framework is one of the most popular available in the Node.js ecosystem. Express is both minimal and flexible, but can handle surprisingly large projects. The framework’s creators worked hard to provide fundamental web application features without changing underlying Node.js features.

  2. Hapi.js: As a framework, Hapi.js is fully-featured, especially when you take into account the many plug-ins that Hapi fans have created. This framework’s creators focused on reliability and stability.

  3. Sails.js: Meant for enterprise-grade apps, Sails.js scales well. One of the biggest benefits of using this framework is its powerful data access layer, which lets you get a lot more out of any database you choose to work with.

  4. Mojito: As one of Yahoo’s Cocktails (as the company calls its mobile application development platform based on open web standards), Mojito has more resources than many other frameworks. It is a robust option for mobile applications.

  5. Koa: Created by the same team as Express, Koa is perhaps the next step in where Node.js can go. The framework uses generators to improve error handling, as well as ditches middleware, to create a fast and scalable experience.

Finding exactly the perfect Node.js framework for a project may require a little experimentation, but these frameworks are all maintained with a certain level of documentation, making it possible to dive in and quickly try out your different options.

The Continuing Evolution of MVC and Isomorphic JavaScript
While the concept of MVC first evolved for desktop applications, the pattern has been adapted as a key approach for web-based applications. Even today, many common MVC frameworks, such as Ruby on Rails, put most of the burden of the model, view, and controller logic on the server. However, modern web applications have evolved to take advantage of maturing client technologies, allowing new frameworks to handle more of the MVC logic on the client. The result is isomorphic JavaScript, an approach that enables you to use MVC patterns across both the client and the server.

Simply put, isomorphic JavaScript is rendered on both the server and the client: the back end and the front end of an application run the same code. When a visitor reaches a web-based application using isomorphic JavaScript, the following occurs:

  1. HTML is rendered from JavaScript application on the server

  2. The browser loads with full HTML

  3. JavaScript loads, and then bootstraps, the application

Isomorphic JavaScript opens up some unusual opportunities though you should remember that not everything will render particularly well from the server. Are you dealing with a great deal of data while generating HTML for your application? You’ll want to stick with sending a limited initial query to the server and then fetch everything else with an AJAX call.

With that caveat, though, isomorphic JavaScript offers valuable improvements:

  • Perceived faster load times (due to the time many popular JavaScript frameworks require to render into the DOM)

  • Improved visibility of your application data for search engine indexing

  • Normalized functionality of your web application even for users who have JavaScript turned off

  • Dramatically reduced code maintenance (given that you can use the same code base for both client and server, you have less code to maintain)

Not all Node.js frameworks rely on MVC as a design pattern, nor is doing so necessary to implement isomorphic JavaScript. However, using a familiar design pattern makes for an easier entry into these concepts.

The post A Practical Guide to Popular Node.js MVC Frameworks appeared first on Application Performance Monitoring Blog | AppDynamics.

More Stories By AppDynamics Blog

In high-production environments where release cycles are measured in hours or minutes — not days or weeks — there's little room for mistakes and no room for confusion. Everyone has to understand what's happening, in real time, and have the means to do whatever is necessary to keep applications up and running optimally.

DevOps is a high-stakes world, but done well, it delivers the agility and performance to significantly impact business competitiveness.

@ThingsExpo Stories
"Cloud Academy is an enterprise training platform for the cloud, specifically public clouds. We offer guided learning experiences on AWS, Azure, Google Cloud and all the surrounding methodologies and technologies that you need to know and your teams need to know in order to leverage the full benefits of the cloud," explained Alex Brower, VP of Marketing at Cloud Academy, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clar...
In his session at 21st Cloud Expo, Carl J. Levine, Senior Technical Evangelist for NS1, will objectively discuss how DNS is used to solve Digital Transformation challenges in large SaaS applications, CDNs, AdTech platforms, and other demanding use cases. Carl J. Levine is the Senior Technical Evangelist for NS1. A veteran of the Internet Infrastructure space, he has over a decade of experience with startups, networking protocols and Internet infrastructure, combined with the unique ability to it...
"IBM is really all in on blockchain. We take a look at sort of the history of blockchain ledger technologies. It started out with bitcoin, Ethereum, and IBM evaluated these particular blockchain technologies and found they were anonymous and permissionless and that many companies were looking for permissioned blockchain," stated René Bostic, Technical VP of the IBM Cloud Unit in North America, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Conventi...
Gemini is Yahoo’s native and search advertising platform. To ensure the quality of a complex distributed system that spans multiple products and components and across various desktop websites and mobile app and web experiences – both Yahoo owned and operated and third-party syndication (supply), with complex interaction with more than a billion users and numerous advertisers globally (demand) – it becomes imperative to automate a set of end-to-end tests 24x7 to detect bugs and regression. In th...
Widespread fragmentation is stalling the growth of the IIoT and making it difficult for partners to work together. The number of software platforms, apps, hardware and connectivity standards is creating paralysis among businesses that are afraid of being locked into a solution. EdgeX Foundry is unifying the community around a common IoT edge framework and an ecosystem of interoperable components.
"MobiDev is a software development company and we do complex, custom software development for everybody from entrepreneurs to large enterprises," explained Alan Winters, U.S. Head of Business Development at MobiDev, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
Large industrial manufacturing organizations are adopting the agile principles of cloud software companies. The industrial manufacturing development process has not scaled over time. Now that design CAD teams are geographically distributed, centralizing their work is key. With large multi-gigabyte projects, outdated tools have stifled industrial team agility, time-to-market milestones, and impacted P&L stakeholders.
"Space Monkey by Vivent Smart Home is a product that is a distributed cloud-based edge storage network. Vivent Smart Home, our parent company, is a smart home provider that places a lot of hard drives across homes in North America," explained JT Olds, Director of Engineering, and Brandon Crowfeather, Product Manager, at Vivint Smart Home, in this SYS-CON.tv interview at @ThingsExpo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
"Akvelon is a software development company and we also provide consultancy services to folks who are looking to scale or accelerate their engineering roadmaps," explained Jeremiah Mothersell, Marketing Manager at Akvelon, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
Coca-Cola’s Google powered digital signage system lays the groundwork for a more valuable connection between Coke and its customers. Digital signs pair software with high-resolution displays so that a message can be changed instantly based on what the operator wants to communicate or sell. In their Day 3 Keynote at 21st Cloud Expo, Greg Chambers, Global Group Director, Digital Innovation, Coca-Cola, and Vidya Nagarajan, a Senior Product Manager at Google, discussed how from store operations and ...
"There's plenty of bandwidth out there but it's never in the right place. So what Cedexis does is uses data to work out the best pathways to get data from the origin to the person who wants to get it," explained Simon Jones, Evangelist and Head of Marketing at Cedexis, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
SYS-CON Events announced today that CrowdReviews.com has been named “Media Sponsor” of SYS-CON's 22nd International Cloud Expo, which will take place on June 5–7, 2018, at the Javits Center in New York City, NY. CrowdReviews.com is a transparent online platform for determining which products and services are the best based on the opinion of the crowd. The crowd consists of Internet users that have experienced products and services first-hand and have an interest in letting other potential buye...
SYS-CON Events announced today that Telecom Reseller has been named “Media Sponsor” of SYS-CON's 22nd International Cloud Expo, which will take place on June 5-7, 2018, at the Javits Center in New York, NY. Telecom Reseller reports on Unified Communications, UCaaS, BPaaS for enterprise and SMBs. They report extensively on both customer premises based solutions such as IP-PBX as well as cloud based and hosted platforms.
It is of utmost importance for the future success of WebRTC to ensure that interoperability is operational between web browsers and any WebRTC-compliant client. To be guaranteed as operational and effective, interoperability must be tested extensively by establishing WebRTC data and media connections between different web browsers running on different devices and operating systems. In his session at WebRTC Summit at @ThingsExpo, Dr. Alex Gouaillard, CEO and Founder of CoSMo Software, presented ...
WebRTC is great technology to build your own communication tools. It will be even more exciting experience it with advanced devices, such as a 360 Camera, 360 microphone, and a depth sensor camera. In his session at @ThingsExpo, Masashi Ganeko, a manager at INFOCOM Corporation, introduced two experimental projects from his team and what they learned from them. "Shotoku Tamago" uses the robot audition software HARK to track speakers in 360 video of a remote party. "Virtual Teleport" uses a multip...
A strange thing is happening along the way to the Internet of Things, namely far too many devices to work with and manage. It has become clear that we'll need much higher efficiency user experiences that can allow us to more easily and scalably work with the thousands of devices that will soon be in each of our lives. Enter the conversational interface revolution, combining bots we can literally talk with, gesture to, and even direct with our thoughts, with embedded artificial intelligence, whic...
SYS-CON Events announced today that Evatronix will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Evatronix SA offers comprehensive solutions in the design and implementation of electronic systems, in CAD / CAM deployment, and also is a designer and manufacturer of advanced 3D scanners for professional applications.
Leading companies, from the Global Fortune 500 to the smallest companies, are adopting hybrid cloud as the path to business advantage. Hybrid cloud depends on cloud services and on-premises infrastructure working in unison. Successful implementations require new levels of data mobility, enabled by an automated and seamless flow across on-premises and cloud resources. In his general session at 21st Cloud Expo, Greg Tevis, an IBM Storage Software Technical Strategist and Customer Solution Architec...
To get the most out of their data, successful companies are not focusing on queries and data lakes, they are actively integrating analytics into their operations with a data-first application development approach. Real-time adjustments to improve revenues, reduce costs, or mitigate risk rely on applications that minimize latency on a variety of data sources. In his session at @BigDataExpo, Jack Norris, Senior Vice President, Data and Applications at MapR Technologies, reviewed best practices to ...
An increasing number of companies are creating products that combine data with analytical capabilities. Running interactive queries on Big Data requires complex architectures to store and query data effectively, typically involving data streams, an choosing efficient file format/database and multiple independent systems that are tied together through custom-engineered pipelines. In his session at @BigDataExpo at @ThingsExpo, Tomer Levi, a senior software engineer at Intel’s Advanced Analytics gr...