Modern Architectures with Spring and JavaScript

Mar$n	
  Lippert
MODERN	
  ARCHITECTURES	
  WITH	
  
  SPRING	
  AND	
  JAVASCRIPT
          mlippert@vmware.com
              @mar$nlippert
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
Typical Runtime Structures



     Browser          render HTML



                      business logic &
Tomcat / tc Server
                      page rendering



Relational Database    contains data
More Detail...


      Browser-based
     HTML Rendering
                                 Browser




  View                          Application
              Controllers
Generation                        Server

      Service Layer

Channels     Repositories           RDBMS
What happens?


                         render HTML & improved
     Browser
                         experience using JavaScript
            AJAX calls


                              business logic &
Tomcat / tc Server         page rendering & APIs


                            contains data & new
Relational Database
                         challenges (structure, size)
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 & new
Relational Database
                           challenges (structure, size)
Different pictures


AWS             node.js                HTML/CSS
          NoSQL               Java
                                     JavaScript
JavaScript      Hadoop
          CoffeeScript


  modern apps                old style apps

  Scala
             Ruby/Rails      Application
 Clojure          PaaS         Server
                                           RDBMS
          HTML5/CSS3
Where do we go
    from here?
The

Client
  Side
Innovation happens here
The JavaScript Story




            http://www.maztek.com/blog/wp-content/uploads/javascript.jpg
My assumptions
             - on the client side -




       Browser only (HTML5/CSS3)
             JavaScript only


   „The browser-based application
written in JavaScript becomes the new
       rich client architecture“
More Detail...

 Browser-based
HTML Rendering
                 HTML5 & JS Engine

            DOM            Controllers


                 Client-side Model



                                          Web
                                         Storage
Existing JavaScript libs are UI centric
         (focus on making life with the DOM easier)


               most prominent:
                  jquery
JavaScript versions of
„good old rich client patterns“
       begin to appear
         (and are highly necessary)




           Examples
         backbone.js
          angular.js
          ember.js
              ...
Browser App (JavaScript)



        maybe also CoffeeScript,
           TypeScript, Dart


  maybe GWT, but likely not



     forget about JSF ;-)
The

Server
  Side
View
                  Controllers
Generation
                                    business/domain
                                        services
      Service Layer
     Service       Service             Service
Channels     Repositories                     RDBMS
             Service      Service      Service

                                             platform
                                             services


   RDBMS               NoSQL         other
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
Service


  Spring MVC is the easiest way to
implement 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
Service


Spring Integration &
     Messaging


    Spring Batch
My assumptions
            - server side languages -




     many different languages in use
choose the right language for the right job
    don‘t use a new language for fun
My assumptions
             - data storage -




     more and more data (big data)
different storage techniques combined
     (rdbms, nosql, graph databases)
         scalability is important
The picture

      HTML5 & JS Engine
                                             Browser
      DOM           Controllers


          Client-side Model                 Web Storage




                                            business/domain
Service           Service         Service
                                                services

                                               platform
    Service         Service       Service      services




RDBMS              NoSQL           other         PaaS
Communication

                     Browser App
                        (JavaScript)




RESTful API                                  Push
  (JSON over http)                     (JSON over WebSockets)




                      Service
The

Challenges
Modularity
    in
JavaScript
AMD
 (asynchronous module definition)

             wire.js
(Dependency Injection for JavaScript)

Micro Services for JavaScript
(OSGi services written in JavaScript)
More Challenges
offline
cloud-ready services
define good APIs
versioned APIs
TDD for JavaScript
more information
                Adrian Colyer on Application Development in the Cloud Era
                      http://www.youtube.com/watch?v=axOPJbrIjkY

Example 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
Q&A
and thank you for your attention




        Martin Lippert,VMware
mlippert@vmware.com, @martinlippert
1 of 31

More Related Content

What's hot(20)

Kubernetes  your next application serverKubernetes  your next application server
Kubernetes your next application server
Red Hat Developers1.6K views
Planning Your Cloud StrategyPlanning Your Cloud Strategy
Planning Your Cloud Strategy
Imesh Gunaratne433 views
Building Killer RESTful APIs with NodeJsBuilding Killer RESTful APIs with NodeJs
Building Killer RESTful APIs with NodeJs
Srdjan Strbanovic9.6K views
Blue whale, jail and MicrosoftBlue whale, jail and Microsoft
Blue whale, jail and Microsoft
Lukasz Kaluzny1.6K views
Azure and web sites hackaton deckAzure and web sites hackaton deck
Azure and web sites hackaton deck
Alexey Bokov1.1K views
Getting Started with DockerGetting Started with Docker
Getting Started with Docker
visual28137 views
Spring on KubernetesSpring on Kubernetes
Spring on Kubernetes
Jay Lee96 views
Infrastructure as Code and AWS CDKInfrastructure as Code and AWS CDK
Infrastructure as Code and AWS CDK
SupratipBanerjee141 views
Unpacking .NET Core | EastBanc TechnologiesUnpacking .NET Core | EastBanc Technologies
Unpacking .NET Core | EastBanc Technologies
EastBanc Tachnologies473 views

Similar to Modern Architectures with Spring and JavaScript(20)

Wakanda - apps.berlin.js - 2012-11-29Wakanda - apps.berlin.js - 2012-11-29
Wakanda - apps.berlin.js - 2012-11-29
Alexandre Morgaut3K views
adrian coyler open tour keynoteadrian coyler open tour keynote
adrian coyler open tour keynote
marklucovsky293 views
Comm Gate Corporate Profile V0.4Comm Gate Corporate Profile V0.4
Comm Gate Corporate Profile V0.4
Abhik Biswas413 views
CM WebClient for CA PlexCM WebClient for CA Plex
CM WebClient for CA Plex
CM First Group2.7K views
New Ways To Engage With Tiempo 2011New Ways To Engage With Tiempo 2011
New Ways To Engage With Tiempo 2011
Tiempo Development343 views
The Modern Web, Part 2: HTML5The Modern Web, Part 2: HTML5
The Modern Web, Part 2: HTML5
David Pallmann1.8K views
SQL Data Service OverviewSQL Data Service Overview
SQL Data Service Overview
Eric Nelson916 views
Shreeraj-Hacking_Web_2Shreeraj-Hacking_Web_2
Shreeraj-Hacking_Web_2
guest66dc5f51.5K views
No SQL at The GuardianNo SQL at The Guardian
No SQL at The Guardian
Mat Wall1.3K views
NoSql presentationNoSql presentation
NoSql presentation
Mat Wall25.4K views
Viridians on RailsViridians on Rails
Viridians on Rails
Viridians444 views
Why we chose mongodb for guardian.co.ukWhy we chose mongodb for guardian.co.uk
Why we chose mongodb for guardian.co.uk
Graham Tackley35.3K views
Seeding The CloudSeeding The Cloud
Seeding The Cloud
Ted Leung3.1K views
Crash Course HTML/Rails SlidesCrash Course HTML/Rails Slides
Crash Course HTML/Rails Slides
Udita Plaha3.8K views

Modern Architectures with Spring and JavaScript

  • 1. Mar$n  Lippert MODERN  ARCHITECTURES  WITH   SPRING  AND  JAVASCRIPT mlippert@vmware.com @mar$nlippert
  • 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. Typical Runtime Structures Browser render HTML business logic & Tomcat / tc Server page rendering Relational Database contains data
  • 4. More Detail... Browser-based HTML Rendering Browser View Application Controllers Generation Server Service Layer Channels Repositories RDBMS
  • 5. What happens? render HTML & improved Browser experience using JavaScript AJAX calls business logic & Tomcat / tc Server page rendering & APIs contains data & new Relational Database challenges (structure, size)
  • 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 & new Relational Database challenges (structure, size)
  • 7. Different pictures AWS node.js HTML/CSS NoSQL Java JavaScript JavaScript Hadoop CoffeeScript modern apps old style apps Scala Ruby/Rails Application Clojure PaaS Server RDBMS HTML5/CSS3
  • 8. Where do we go from here?
  • 11. The JavaScript Story http://www.maztek.com/blog/wp-content/uploads/javascript.jpg
  • 12. My assumptions - on the client side - Browser only (HTML5/CSS3) JavaScript only „The browser-based application written in JavaScript becomes the new rich client architecture“
  • 13. More Detail... Browser-based HTML Rendering HTML5 & JS Engine DOM Controllers Client-side Model Web Storage
  • 14. Existing JavaScript libs are UI centric (focus on making life with the DOM easier) most prominent: jquery
  • 15. JavaScript versions of „good old rich client patterns“ begin to appear (and are highly necessary) Examples backbone.js angular.js ember.js ...
  • 16. Browser App (JavaScript) maybe also CoffeeScript, TypeScript, Dart maybe GWT, but likely not forget about JSF ;-)
  • 18. View Controllers Generation business/domain services Service Layer Service Service Service Channels Repositories RDBMS Service Service Service platform services RDBMS NoSQL other
  • 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. Service Spring MVC is the easiest way to implement 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. Service Spring Integration & Messaging Spring Batch
  • 22. My assumptions - server side languages - many different languages in use choose the right language for the right job don‘t use a new language for fun
  • 23. My assumptions - data storage - more and more data (big data) different storage techniques combined (rdbms, nosql, graph databases) scalability is important
  • 24. The picture HTML5 & JS Engine Browser DOM Controllers Client-side Model Web Storage business/domain Service Service Service services platform Service Service Service services RDBMS NoSQL other PaaS
  • 25. Communication Browser App (JavaScript) RESTful API Push (JSON over http) (JSON over WebSockets) Service
  • 27. Modularity in JavaScript
  • 28. AMD (asynchronous module definition) wire.js (Dependency Injection for JavaScript) Micro Services for JavaScript (OSGi services written in JavaScript)
  • 29. More Challenges offline cloud-ready services define good APIs versioned APIs TDD for JavaScript
  • 30. more information Adrian Colyer on Application Development in the Cloud Era http://www.youtube.com/watch?v=axOPJbrIjkY Example 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. Q&A and thank you for your attention Martin Lippert,VMware mlippert@vmware.com, @martinlippert