AngularJS with Springboot (ReST MVC) and jackson

Reflections on a delivered project:

After considering a JHipster like starting point we decided to roll up something on our own with similar components. We were not constrained with database setup or interaction. Our data source was a data feed using google protocol buffers. Google protocol buffers does offer a JSON data structure output, but that would only work if your GPB structure was near your desired JSON output for AngularJS consumption. Also the other part of the problem was that the GBP provided a larger data set then was consumable by the user on a single screen. Because of this issue, ehcache entered the picture and we used our middle layer, JAVA service layer, to paginate the data into more consumable pieces. The Bean to JSON framewwork we used to provide JSON to AngularJS was Jackson. Jackson is able to take JAVA beans and output JSON for out ReST calls. With Springboot, we setup our project to be deployed as one artifact and launched with [java -jar <artifact>] where the artifact was our AngularJS and Java combined project.

On the AngularJs side of things we used ng-table and ng-grid extensively. We implemented a drill down tree that could be reseeded. The drill down process would request additional data from the server as the user interacted with the table data and drilled down in the values. Table pagination was accomplished in a similar fashion.

Tech Stack

  • Java 1.7
  • Springboot
  • Spring 4 MVC ReST
  • Jackson
  • Ehcache
  • TestNG
  • Mockito
  • AngularJS 1.2.26
  • trNgGrid 3.0.3
  • ng-table 0.3.3
  • karma
  • protractor
  • Jenkins

Proud of:

  • Problem solving for table drilldown, and re-seeding feature.
  • Use of Springboot, rapid development and deploy, when using Intellij Idea.
  • CI environment, with js unit testing, js e2e tests, and TestNG with mockito for Java unit tesing, also the fact that we could get code coverage for both our Java and Javascript code.

Lessons Learned:

  • User beware of AngularJS components that are not well established.
  • Make sure your CI envionment meet the requirments for running chromedriver for Protractor with Jasmine (we abandoned CentOS for this reason)
  • There exists some issues when choosing Firefox or Chrome as your browser for protractor. One option worked great on our development environment but the other worked better for our build environment.
  • Using Intellij Idea helped us with rapid of development even when we deploying AngularJS and Java in the same artifact and using Springboot. Had we not used Intellij Idea, then splitting up the two layers for deployment would have lent itself better to ensuring a development environment where we could hot deploy the java code and have instantaneous feedback from AngularJs code changes.
It's only fair to share...
Share on FacebookGoogle+Tweet about this on TwitterShare on LinkedIn