Modern Architectures with Spring and JavaScript

8,443 views

Published on

JavaScript becomes more and more important for implementing full-featured rich client applications in the browser. Therefore our classical ideas and blueprints for Spring-based architectures have to change. This talks provides a high-level overview of these changes and talks about how to combine Spring on the server side to implement RESTful and HATEOAS APIs and JavaScript in the client side to realize full client side apps in your browser. The talk discusses the basic ideas and motivations behind this shift in architectures without going too deep into all the technical details.

Published in: Technology
0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
8,443
On SlideShare
0
From Embeds
0
Number of Embeds
48
Actions
Shares
0
Downloads
56
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide

Modern Architectures with Spring and JavaScript

  1. 1. Mar$n  LippertMODERN  ARCHITECTURES  WITH   SPRING  AND  JAVASCRIPT mlippert@vmware.com @mar$nlippert
  2. 2. about me Mar6n  Lippert Staff  Engineer,  R&D,  at  SpringSource/ VMware  and  lead  of  Spring  Tool  Suite   development Working  areas •Eclipse  Tooling  for  the  Spring  plaAorm •Open  Source  CommiDer •Aspect-­‐Weaving  for  OSGi •Cloud  IDEs  and  JavaScript •Agile  soKware  development 2
  3. 3. Typical Runtime Structures Browser render HTML business logic &Tomcat / tc Server page renderingRelational Database contains data
  4. 4. More Detail... Browser-based HTML Rendering Browser View Application ControllersGeneration Server Service LayerChannels Repositories RDBMS
  5. 5. What happens? render HTML & improved Browser experience using JavaScript AJAX calls business logic &Tomcat / tc Server page rendering & APIs contains data & newRelational Database challenges (structure, size)
  6. 6. A few observations duplicated logic, no modularization render HTML & improved Browser experience using JavaScript AJAX calls APIs are challenging, Java not the only language anymore business logic &Tomcat / tc Server page rendering & APIs relational & transactional contains anymore don‘t fit data & newRelational Database challenges (structure, size)
  7. 7. Different picturesAWS node.js HTML/CSS NoSQL Java JavaScriptJavaScript Hadoop CoffeeScript modern apps old style apps Scala Ruby/Rails Application Clojure PaaS Server RDBMS HTML5/CSS3
  8. 8. Where do we go from here?
  9. 9. TheClient Side
  10. 10. Innovation happens here
  11. 11. The JavaScript Story http://www.maztek.com/blog/wp-content/uploads/javascript.jpg
  12. 12. My assumptions - on the client side - Browser only (HTML5/CSS3) JavaScript only „The browser-based applicationwritten in JavaScript becomes the new rich client architecture“
  13. 13. More Detail... Browser-basedHTML Rendering HTML5 & JS Engine DOM Controllers Client-side Model Web Storage
  14. 14. Existing JavaScript libs are UI centric (focus on making life with the DOM easier) most prominent: jquery
  15. 15. JavaScript versions of„good old rich client patterns“ begin to appear (and are highly necessary) Examples backbone.js angular.js ember.js ...
  16. 16. Browser App (JavaScript) maybe also CoffeeScript, TypeScript, Dart maybe GWT, but likely not forget about JSF ;-)
  17. 17. TheServer Side
  18. 18. View ControllersGeneration business/domain services Service Layer Service Service ServiceChannels Repositories RDBMS Service Service Service platform services RDBMS NoSQL other
  19. 19. this is where Spring is really powerful ready to run „in the cloud“ (scalability) (no client-side rendering or logic)Service Service Service Service Service
  20. 20. Service Spring MVC is the easiest way toimplement RESTful APIs and services APIs are JSON and HATEOAS based Spring MVC + Spring HATEOAS is a powerful combination more on Spring HATEOAS: https://github.com/SpringSource/spring-hateoas
  21. 21. ServiceSpring Integration & Messaging Spring Batch
  22. 22. My assumptions - server side languages - many different languages in usechoose the right language for the right job don‘t use a new language for fun
  23. 23. My assumptions - data storage - more and more data (big data)different storage techniques combined (rdbms, nosql, graph databases) scalability is important
  24. 24. The picture HTML5 & JS Engine Browser DOM Controllers Client-side Model Web Storage business/domainService Service Service services platform Service Service Service servicesRDBMS NoSQL other PaaS
  25. 25. Communication Browser App (JavaScript)RESTful API Push (JSON over http) (JSON over WebSockets) Service
  26. 26. TheChallenges
  27. 27. Modularity inJavaScript
  28. 28. AMD (asynchronous module definition) wire.js(Dependency Injection for JavaScript)Micro Services for JavaScript(OSGi services written in JavaScript)
  29. 29. More Challengesofflinecloud-ready servicesdefine good APIsversioned APIsTDD for JavaScript
  30. 30. more information Adrian Colyer on Application Development in the Cloud Era http://www.youtube.com/watch?v=axOPJbrIjkYExample app using Spring for providing RESTful APIs and JavaScript for a rich client and mobile app https://github.com/SpringSource/html5expense Asynchronous Module Definition for JavaScript (AMD) https://github.com/amdjs/amdjs-api http://requirejs.org/docs/whyamd.html wire.js https://github.com/cujojs/wire hello world with wire.js https://github.com/briancavalier/hello-wire.js more advanced example for wire.js https://github.com/briancavalier/piratescript Cloud Foundry PaaS http://www.cloudfoundry.com http://www.cloudfoundry.org
  31. 31. Q&Aand thank you for your attention Martin Lippert,VMwaremlippert@vmware.com, @martinlippert

×