Monthly Archives: September 2016

Getting MEAN: A Java Developer’s Perspective

I intimidate many people because I’m so pretty. Others might say I’m pretty ugly. But when I had the chance to get MEAN too, I jumped at it. In this context, MEAN is an acronym for the technology stack consisting of: MongoDB, Express, AngularJS and NodeJS. I wanted to briefly document some of my recent experiences and take-aways in working with this technology stack, so here are my thoughts.

For most of my programming career now, I’ve been working with mostly Enterprise Java. I started teaching myself Java in the mid-nineties from an O’Reilly book and from the start found the language very intuitive to understand (then). For a number of years now, however, I’ve been thinking that full-stack JavaScript is the way to go for Enterprise Software Development (and other applications as well). So when I had the opportunity to work on a short project using MEAN I was quite glad to get some hands-on experience with it.

First of all, when working with MEAN, you are essentially using the JavaScript language at all layers of application development, from the front-end to the middle-tier to the back-end data store. Theoretically, this should make the learning curve considerably smaller when working across layers, and should also make JavaScript Developers equally interchangeable across layers. The reality, however, is not quite that, but it’s close.

‘M’ Is For MongoDB

MongoDB is a NoSQL database used for storing JSON Documents. MongoDB is very easy to install and run, especially on Linux-based systems. You can run JavaScript in the database; you can even write MapReduce programs in JavaScript and run them on the database. But the main advantage of using MongoDB in this technology stack is the ability to easily store and retrieve JSON documents without have to apply JSON structure to your data after pulling it out of the database. This makes it easier to ship JSON formatted data directly to your front-end without having to mess with RDBMS tables and SQL… and even DBA’s for that matter (‘…can you PLEASE create a table for me!’). Wait, I don’t say ‘please’ anymore because I’m MEAN.

‘E’ Is For Express

Express is a dream to work with. It’s very simple and intuitive to use and takes no time at all to go from knowing nothing to creating fairly complex JSON REST Web Services. We connected Express to our MongoDB instance using Mongoose, which is so simple even I could configure it. Simple is good, right?

‘A’ Is For AngularJS

I found working in Angular 1.x fairly difficult to understand. The associated documentation is not all that well written and generally not very helpful. I feel like the framework is a bit over-engineered. I have not worked with Angular 2.x yet, so perhaps things have improved. Nevertheless, many, many organizations have invested heavily in Angular, so I’m sure I must be missing something, and without a doubt AngularJS is better than working with Java Server Faces (JSF) or Struts. Nevertheless, I might actually try ReactJS as the front-end framework next time as several co-workers have strongly recommended it.

‘N’ Is For NodeJS

NodeJS is the server-side JavaScript middleware that ran our Express JSON REST Services. Working with NodeJS requires that you get used to writing asynchronous code, but once you get the hang of that it’s quite fun and easy to use. From a Java Developer’s perspective, working with NodeJS is so much more efficient than having to compile and package Java Code into a WAR or EAR before deploying it to a JEE Container, like Tomcat or JBoss or Websphere or Weblogic. In Java land, that process seems to take years sometimes. When using NodeJS and a code monitor like nodemon, you simply forget about about the code deploy process and start to take for granted that your code changes are instantly available for testing on your local server. What?!?!

The Node Package Manager (npm) makes installing and managing modules very easy as well.

Fast Development, Fast Deployment

As mentioned, using code watch tools like nodemon, or even grunt or gulp serve-up local code changes in real-time. That speeds up development time significantly. Moreover, your mocha, chai, karma, etc. test scripts are invoked automatically each time you make a code change, so feedback on whether your build is broken or not is instant and continuous. Once integrated with an efficient Continuous Integration/Continuous Delivery (CI/CD) Pipeline, code commits to Git can be automatically built, tested and pushed-out to a running server in your environment of choice. Of course you can do the same in Java, but I bet that MEAN Developers can develop twice the functionality, if not more, than Java Developers in the same amount of time.

In business, speed kills when your MEAN (and pretty).

The Boys in the Boat

Book Review: The Boys In The Boat

I just finished reading the book, ‘The Boys In The Boat’ by Daniel James Brown, and I can honestly say that this is one of the best books I have ever read.  This book is about a team of 9 University of Washington, depression-era oarsmen, with a focus on one particular rower, Joe Rantz, who mesmerized America and the World by defeating Germany and Italy in the 1936 Olympics in Berlin.

I was particular struck by how Washington Coach, Al Ulbrickson, struggled to understand the inner workings of his most talented oarsmen, what made them tick, and how to get them to gel as a team. But once the right mix of oarsmen was discovered in the 8+ cox configuration, the team was literally unstoppable and undefeated. In my blog post about ‘Building Great Software Teams’, I talk about the importance of building the right team over individuals, and how the benefits can be astounding and greater than the sum of it’s individual parts. So it was with the success of the University of Washington 8+ 1936 Olympic Rowing Team.

The Boys in the Boat
The Boys in the Boat

Author Daniel James Brown does an amazing job of interweaving other historic facts with the facts of this story. For example, he describes how the Zeppelin ‘Hindenburg’ launched from New Jersey to fly to Germany at the same time the 1936 USA Olympic Contingent left for Germany on board the S.S Manhattan; and how Nazi Film Directory, Leni Riefenstahl, played such a pivotal role in her movie documentation of the final Men’s 8+ Sweep Race in hopes of documenting Nazi Germany’s supremacy in rowing events on the Langer See, but instead captured an epic American victory over Germany and Italy, which instead ultimately foreshadowed their demise in WWII.

The author also helps to remind us that even as difficult and scary as the Great Depression and WWII were, many great stories of perseverance and success, such as the one of the University of Washington 8+, arose from the ashes of their circumstances. And this is a comforting reminder as we remember the events of 9/11/2001.

If you are are interested in reading this book, please click the Amazon Affiliate Link below to purchase.