SlideShare ist ein Scribd-Unternehmen logo
1 von 29
Downloaden Sie, um offline zu lesen
Architecture of a Modern Web App
                              Jeremy Grelle, SpringSource Staff Engineer
                                    Github / Twitter: @jeremyg484




      1
Thursday, December 13, 12
Overview

        •   Where we’ve been
        •   Where we’re going
        •   How we’ll get there
        •   Questions




             2
Thursday, December 13, 12
In the beginning...
       • Sites were static HTML   Pros:
                                  • low computational overhead
                                  • highly cacheable
                                  • highly indexable

                                  Cons:
                                  • hard (easy?) to update
                                  • no personalization
                                  • usually poor UI




             3
Thursday, December 13, 12
Let there be CGI
       • Introduced dynamic generated   Pros:
         pages                          • dynamic!
                                        • selectively cacheable
                                        • highly indexable
                                        • personalizable

                                        Cons:
                                        • “high” computational overhead
                                        • hard to create
                                        • usually poor UI



             4
Thursday, December 13, 12
LiveScript JavaScript
       • Dynamic pages                                                         Pros:
       • Lightweight alternative to applets                                    • enhanced usability, maybe
       • Mostly used for simple scripting                                      • reduced trips to the server
         – basic form validation
         – popup ads                                                           Cons:
         – comet cursor trails                                                 • abuses annoyed users
                                                                               • business logic often implemented
                                                                                 twice: client and server




                            http://en.wikipedia.org/wiki/File:Pop-up_ads.jpg

             5
Thursday, December 13, 12
AJAX - Web 2.0
       • Google Maps sparked Web 2.0   Pros:
       • GMail                         • killer UI
         – required JavaScript         • more responsive apps

                                       Cons:
                                       • difficult to cache
                                       • impossible to index
                                       • required JavaScript




             6
Thursday, December 13, 12
Unobtrusive JavaScript
       • No JavaScript, no problem          Pros:
       • Provide features for user agents   • wider compatibility
         that support them                  • just as rich UI
          – fall back to basic HTML         • just as responsive

                                            Cons:
                                            • higher development costs
                                            • requires thoughtful engineering




             7
Thursday, December 13, 12
Client Side Applications
       • Business logic lives on the client   Pros:
       • Resources and permanent state        • reduce server workloads
         stored on the server                 • application is highly cacheable
       • Application state stored on client   • extremely rich UI

                                              Cons:
                                              • content not indexable
                                              • requires JavaScript
                                              • often requires a ‘modern’ browser




             8
Thursday, December 13, 12
Overview

        •   Where we’ve been
        •   Where we’re going
        •   How we’ll get there
        •   Questions




             9
Thursday, December 13, 12
From: server-side apps
           To: smart clients and services




                   10
Thursday, December 13, 12
Client
                             Browser-based

                            HTML Rendering

                              (progressive          Browser
                             enhancement)


                    HTML                     HTTP

                   View                             Application
                            Controllers             Server
                 Generation

                            Service Layer

                Channels Repositories                         RDBMS
                                                              CRUD    Server
Thursday, December 13, 12
HTML5 & JS Engine             Browser app or       Client
                                                    embedded in native
                            DOM       Controllers

                            Client-side model
                                                            web stg




                            Service Layer

                Channels Repositories                        RDBMS

                                                              CRUD       Server
Thursday, December 13, 12
HTML5 & JS Engine                 Browser app or        Client
                                                        embedded in native
                            DOM       Controllers

                            Client-side model
                                                                    web stg

                     JSON                       HTTP & websockets




                            Service Layer

                Channels Repositories                                RDBMS

                                                                      CRUD    Server
Thursday, December 13, 12
HTML5 & JS Engine                 Browser app or        Client
                                                        embedded in native
                            DOM       Controllers

                            Client-side model
                                                                    web stg

                     JSON          events       HTTP & websockets
                               & notifications




                            Service Layer

                Channels Repositories                                RDBMS

                                                                      CRUD    Server
Thursday, December 13, 12
HTML5 & JS Engine                 Browser app or        Client
                                                        embedded in native
                            DOM       Controllers

                            Client-side model
                                                                    web stg

                     JSON          events       HTTP & websockets
                               & notifications




                            Service Layer
                                                                              Cloud/
                Channels Repositories                                RDBMS    PaaS
                                                                      CRUD

Thursday, December 13, 12
HTML5 & JS Engine                 Browser app or        Client
                                                        embedded in native
                            DOM       Controllers

                            Client-side model
                                                                    web stg

                     JSON          events       HTTP & websockets
                               & notifications

                                                           business /
                Service           Service       Service    domain services


                                                                              Cloud/
                Channels Repositories                                RDBMS    PaaS
                                                                      CRUD

Thursday, December 13, 12
HTML5 & JS Engine                 Browser app or        Client
                                                        embedded in native
                            DOM       Controllers

                            Client-side model
                                                                    web stg

                     JSON          events       HTTP & websockets
                               & notifications

                                                           business /
                Service           Service       Service    domain services



                Channels Repositories                                RDBMS
                                                                      CRUD    PaaS
Thursday, December 13, 12
HTML5 & JS Engine                 Browser app or        Client
                                                        embedded in native
                            DOM       Controllers

                            Client-side model
                                                                    web stg

                     JSON          events       HTTP & websockets
                               & notifications

                                                           business /
                Service           Service       Service    domain services




                                                                              PaaS
Thursday, December 13, 12
HTML5 & JS Engine                 Browser app or              Client
                                                        embedded in native
                            DOM        Controllers

                             Client-side model
                                                                 web stg

                   JSON           events    HTTP & websockets
                              & notifications
                                                           business /
               Service            Service        Service   domain services


                        Service       Service        Service   platform services,
                                                               web APIs
                            SQL        NoSQL          Other                         PaaS
Thursday, December 13, 12
HTML5 & JS Engine

                     Applications                             HTML5
                                                              (& native)
                   JSON        events     HTTP & websockets
                                  &
                             notifications


                            Services                          PaaS

Thursday, December 13, 12
Overview

        •   Where we’ve been
        •   Where we’re going
        •   How we’ll get there
        •   Questions




            17
Thursday, December 13, 12
Simplify Views

        • Simple template can render on the client or server
          – JSP, et al will never render client side

        • Avoid imperative logic
        • Lot of conditions may indicate the model is poorly structured

        • Can the model be cleanly serialized?




            18
Thursday, December 13, 12
Client side code as a first class citizen

        •   Apply design patterns
        •   Modularize
        •   Unit test
        •   Enforce code quality

        • See “IoC + JavaScript” coming up next.




            19
Thursday, December 13, 12
Demo
                            Monty Hall




      20
Thursday, December 13, 12
Think Messaging

        • Web Sockets are message based
        • Web Workers are message based
        • DOM Events are message based

        • Web vs Integration is a false dichotomy

        • See “Going Async - Practical Patterns for Push-Enabled Applications”
          coming soon to SpringSource YouTube channel.




            21
Thursday, December 13, 12
Demo
                            Client Server Messaging




      22
Thursday, December 13, 12
Client vs Server

        • The definitions of “back-end” and “front-end” are shifting
          – front-end != client, back-end != server

        • Embrace both sides

        • Specialize in client/server integration




            23
Thursday, December 13, 12
Frameworks

        • New frameworks are emerging
          – not quite prime time
          – watch this space

        • Frameworks will not solve all your issues
          – sorry




            24
Thursday, December 13, 12
Resources

        • s2js - http://www.github.com/s2js

        • cujo.js - http://www.cujojs.com

        • scripted - https://github.com/scripted-editor/scripted

        • SockJS - http://www.sockjs.org

        • Monty Hall REST API - https://github.com/acolyer/monty-hall

        • Monty Hall Client - https://github.com/five-eleven/monty-hall-ui

        • Messaging Demo - https://github.com/jeremyg484/s12gx-push-service/

            25
Thursday, December 13, 12

Weitere ähnliche Inhalte

Was ist angesagt?

Building Mobile Web Apps with jQM and Cordova on Azure
Building Mobile Web Apps with jQM and Cordova on AzureBuilding Mobile Web Apps with jQM and Cordova on Azure
Building Mobile Web Apps with jQM and Cordova on AzureBrian Lyttle
 
Portal at the Speed of Light
Portal at the Speed of LightPortal at the Speed of Light
Portal at the Speed of LightProlifics
 
Don't call us - we'll push - on cross tier push architecture (NLJUG JFall 201...
Don't call us - we'll push - on cross tier push architecture (NLJUG JFall 201...Don't call us - we'll push - on cross tier push architecture (NLJUG JFall 201...
Don't call us - we'll push - on cross tier push architecture (NLJUG JFall 201...Lucas Jellema
 
Google App Engine, Groovy and Gaelyk presentation at the Paris JUG
Google App Engine, Groovy and Gaelyk presentation at the Paris JUGGoogle App Engine, Groovy and Gaelyk presentation at the Paris JUG
Google App Engine, Groovy and Gaelyk presentation at the Paris JUGGuillaume Laforge
 
Responsive Web Design and Sitecore
Responsive Web Design and SitecoreResponsive Web Design and Sitecore
Responsive Web Design and SitecoreJohn Eckman
 
Developer Pitfalls & Strategies for Improving Mobile Web Developer Experience
Developer Pitfalls & Strategies for Improving Mobile Web Developer ExperienceDeveloper Pitfalls & Strategies for Improving Mobile Web Developer Experience
Developer Pitfalls & Strategies for Improving Mobile Web Developer ExperienceTasneem Sayeed
 
WebWorks Development for BlackBerry PlayBook and Smartphones
WebWorks Development for BlackBerry PlayBook and SmartphonesWebWorks Development for BlackBerry PlayBook and Smartphones
WebWorks Development for BlackBerry PlayBook and SmartphonesKyle McInnes
 
Drupal By Design - Business Case for Drupal
Drupal By Design - Business Case for DrupalDrupal By Design - Business Case for Drupal
Drupal By Design - Business Case for DrupalGlenn Lim
 
GateIn - The Solution for Managing and Building Enterprise Web Apps
GateIn - The Solution for Managing and Building Enterprise Web AppsGateIn - The Solution for Managing and Building Enterprise Web Apps
GateIn - The Solution for Managing and Building Enterprise Web AppsWesley Hales
 
Running productioninstance 1-localcopy
Running productioninstance 1-localcopyRunning productioninstance 1-localcopy
Running productioninstance 1-localcopyCloudBees
 
Extending JMS to Web Devices over HTML5 WebSockets - JavaOne 2011
Extending JMS to Web Devices over HTML5 WebSockets - JavaOne 2011Extending JMS to Web Devices over HTML5 WebSockets - JavaOne 2011
Extending JMS to Web Devices over HTML5 WebSockets - JavaOne 2011Peter Moskovits
 
Cloud Camp Chicago Dec 2012 Slides
Cloud Camp Chicago Dec 2012 SlidesCloud Camp Chicago Dec 2012 Slides
Cloud Camp Chicago Dec 2012 SlidesRyan Koop
 
Meetup. Technologies Intro for Non-Tech People
Meetup. Technologies Intro for Non-Tech PeopleMeetup. Technologies Intro for Non-Tech People
Meetup. Technologies Intro for Non-Tech PeopleIT Arena
 
Building Living Web Applications with HTML5 WebSockets
Building Living Web Applications with HTML5 WebSocketsBuilding Living Web Applications with HTML5 WebSockets
Building Living Web Applications with HTML5 WebSocketsPeter Moskovits
 
Anatomy of an HTML 5 mobile web app
Anatomy of an HTML 5 mobile web app Anatomy of an HTML 5 mobile web app
Anatomy of an HTML 5 mobile web app Ivano Malavolta
 
Zimbra - BlanKonf Semarang
Zimbra - BlanKonf SemarangZimbra - BlanKonf Semarang
Zimbra - BlanKonf Semarangprinceofgiri
 

Was ist angesagt? (19)

Building Mobile Web Apps with jQM and Cordova on Azure
Building Mobile Web Apps with jQM and Cordova on AzureBuilding Mobile Web Apps with jQM and Cordova on Azure
Building Mobile Web Apps with jQM and Cordova on Azure
 
2018 jk
2018 jk2018 jk
2018 jk
 
JavaME UI - JMDF 2007
JavaME UI - JMDF 2007JavaME UI - JMDF 2007
JavaME UI - JMDF 2007
 
Plugins Are Blueprints
Plugins Are BlueprintsPlugins Are Blueprints
Plugins Are Blueprints
 
Portal at the Speed of Light
Portal at the Speed of LightPortal at the Speed of Light
Portal at the Speed of Light
 
Don't call us - we'll push - on cross tier push architecture (NLJUG JFall 201...
Don't call us - we'll push - on cross tier push architecture (NLJUG JFall 201...Don't call us - we'll push - on cross tier push architecture (NLJUG JFall 201...
Don't call us - we'll push - on cross tier push architecture (NLJUG JFall 201...
 
Google App Engine, Groovy and Gaelyk presentation at the Paris JUG
Google App Engine, Groovy and Gaelyk presentation at the Paris JUGGoogle App Engine, Groovy and Gaelyk presentation at the Paris JUG
Google App Engine, Groovy and Gaelyk presentation at the Paris JUG
 
Responsive Web Design and Sitecore
Responsive Web Design and SitecoreResponsive Web Design and Sitecore
Responsive Web Design and Sitecore
 
Developer Pitfalls & Strategies for Improving Mobile Web Developer Experience
Developer Pitfalls & Strategies for Improving Mobile Web Developer ExperienceDeveloper Pitfalls & Strategies for Improving Mobile Web Developer Experience
Developer Pitfalls & Strategies for Improving Mobile Web Developer Experience
 
WebWorks Development for BlackBerry PlayBook and Smartphones
WebWorks Development for BlackBerry PlayBook and SmartphonesWebWorks Development for BlackBerry PlayBook and Smartphones
WebWorks Development for BlackBerry PlayBook and Smartphones
 
Drupal By Design - Business Case for Drupal
Drupal By Design - Business Case for DrupalDrupal By Design - Business Case for Drupal
Drupal By Design - Business Case for Drupal
 
GateIn - The Solution for Managing and Building Enterprise Web Apps
GateIn - The Solution for Managing and Building Enterprise Web AppsGateIn - The Solution for Managing and Building Enterprise Web Apps
GateIn - The Solution for Managing and Building Enterprise Web Apps
 
Running productioninstance 1-localcopy
Running productioninstance 1-localcopyRunning productioninstance 1-localcopy
Running productioninstance 1-localcopy
 
Extending JMS to Web Devices over HTML5 WebSockets - JavaOne 2011
Extending JMS to Web Devices over HTML5 WebSockets - JavaOne 2011Extending JMS to Web Devices over HTML5 WebSockets - JavaOne 2011
Extending JMS to Web Devices over HTML5 WebSockets - JavaOne 2011
 
Cloud Camp Chicago Dec 2012 Slides
Cloud Camp Chicago Dec 2012 SlidesCloud Camp Chicago Dec 2012 Slides
Cloud Camp Chicago Dec 2012 Slides
 
Meetup. Technologies Intro for Non-Tech People
Meetup. Technologies Intro for Non-Tech PeopleMeetup. Technologies Intro for Non-Tech People
Meetup. Technologies Intro for Non-Tech People
 
Building Living Web Applications with HTML5 WebSockets
Building Living Web Applications with HTML5 WebSocketsBuilding Living Web Applications with HTML5 WebSockets
Building Living Web Applications with HTML5 WebSockets
 
Anatomy of an HTML 5 mobile web app
Anatomy of an HTML 5 mobile web app Anatomy of an HTML 5 mobile web app
Anatomy of an HTML 5 mobile web app
 
Zimbra - BlanKonf Semarang
Zimbra - BlanKonf SemarangZimbra - BlanKonf Semarang
Zimbra - BlanKonf Semarang
 

Andere mochten auch

Web components, so close!
Web components, so close!Web components, so close!
Web components, so close!Aleks Zinevych
 
SharePoint 2010 farm architecture design infrastructure
SharePoint 2010 farm architecture design infrastructureSharePoint 2010 farm architecture design infrastructure
SharePoint 2010 farm architecture design infrastructureKjell-Sverre Jerijærvi
 
Watson - a supercomputer
Watson - a supercomputerWatson - a supercomputer
Watson - a supercomputerHarshil Darji
 
Modularizing RESTful Web Service Management with Aspect Oriented Programming
Modularizing RESTful Web Service Management with Aspect Oriented ProgrammingModularizing RESTful Web Service Management with Aspect Oriented Programming
Modularizing RESTful Web Service Management with Aspect Oriented ProgrammingWidhian Bramantya
 
Modern Web App Architectures
Modern Web App ArchitecturesModern Web App Architectures
Modern Web App ArchitecturesRaphael Stary
 
IBM Watson & Open Source Software - LinuxCon 2012
IBM Watson & Open Source Software - LinuxCon 2012IBM Watson & Open Source Software - LinuxCon 2012
IBM Watson & Open Source Software - LinuxCon 2012iportilla
 
A Simpler Web App Architecture (jDays 2016)
A Simpler Web App Architecture (jDays 2016)A Simpler Web App Architecture (jDays 2016)
A Simpler Web App Architecture (jDays 2016)Gustaf Nilsson Kotte
 
e-Commerce web app Architecture and Scalability
e-Commerce web app Architecture and Scalabilitye-Commerce web app Architecture and Scalability
e-Commerce web app Architecture and ScalabilityAryashree Pritikrishna
 
Visual Design with Data
Visual Design with DataVisual Design with Data
Visual Design with DataSeth Familian
 

Andere mochten auch (12)

Web components, so close!
Web components, so close!Web components, so close!
Web components, so close!
 
SharePoint 2010 farm architecture design infrastructure
SharePoint 2010 farm architecture design infrastructureSharePoint 2010 farm architecture design infrastructure
SharePoint 2010 farm architecture design infrastructure
 
Watson - a supercomputer
Watson - a supercomputerWatson - a supercomputer
Watson - a supercomputer
 
Modularizing RESTful Web Service Management with Aspect Oriented Programming
Modularizing RESTful Web Service Management with Aspect Oriented ProgrammingModularizing RESTful Web Service Management with Aspect Oriented Programming
Modularizing RESTful Web Service Management with Aspect Oriented Programming
 
Chrome extensions
Chrome extensionsChrome extensions
Chrome extensions
 
Web app architecture
Web app architectureWeb app architecture
Web app architecture
 
Modern Web App Architectures
Modern Web App ArchitecturesModern Web App Architectures
Modern Web App Architectures
 
IBM Watson & Open Source Software - LinuxCon 2012
IBM Watson & Open Source Software - LinuxCon 2012IBM Watson & Open Source Software - LinuxCon 2012
IBM Watson & Open Source Software - LinuxCon 2012
 
A Simpler Web App Architecture (jDays 2016)
A Simpler Web App Architecture (jDays 2016)A Simpler Web App Architecture (jDays 2016)
A Simpler Web App Architecture (jDays 2016)
 
REST vs. SOAP
REST vs. SOAPREST vs. SOAP
REST vs. SOAP
 
e-Commerce web app Architecture and Scalability
e-Commerce web app Architecture and Scalabilitye-Commerce web app Architecture and Scalability
e-Commerce web app Architecture and Scalability
 
Visual Design with Data
Visual Design with DataVisual Design with Data
Visual Design with Data
 

Ähnlich wie Architecture of a Modern Web App - SpringOne India

Building a Single-Page App: Backbone, Node.js, and Beyond
Building a Single-Page App: Backbone, Node.js, and BeyondBuilding a Single-Page App: Backbone, Node.js, and Beyond
Building a Single-Page App: Backbone, Node.js, and BeyondSpike Brehm
 
Cloud Camp Chicago Dec 2012 - All presentations
Cloud Camp Chicago Dec 2012 - All presentationsCloud Camp Chicago Dec 2012 - All presentations
Cloud Camp Chicago Dec 2012 - All presentationsCloudCamp Chicago
 
[DSBW Spring 2009] Unit 05: Web Architectures
[DSBW Spring 2009] Unit 05: Web Architectures[DSBW Spring 2009] Unit 05: Web Architectures
[DSBW Spring 2009] Unit 05: Web ArchitecturesCarles Farré
 
Practical Thin Server Architecture With Dojo Sapo Codebits 2008
Practical Thin Server Architecture With Dojo Sapo Codebits 2008Practical Thin Server Architecture With Dojo Sapo Codebits 2008
Practical Thin Server Architecture With Dojo Sapo Codebits 2008codebits
 
Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoo...
Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoo...Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoo...
Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoo...Esri Nederland
 
12-factor-jruby
12-factor-jruby12-factor-jruby
12-factor-jrubyJoe Kutner
 
Talk 03 responsive-web-design
Talk 03 responsive-web-designTalk 03 responsive-web-design
Talk 03 responsive-web-designMonkeyshot
 
Client Server 3.0 - 6 Ways JavaScript is Revolutionizing the Client/Server Re...
Client Server 3.0 - 6 Ways JavaScript is Revolutionizing the Client/Server Re...Client Server 3.0 - 6 Ways JavaScript is Revolutionizing the Client/Server Re...
Client Server 3.0 - 6 Ways JavaScript is Revolutionizing the Client/Server Re...Jesse Cravens
 
Practical Thin Server Architecture With Dojo Peter Svensson
Practical Thin Server Architecture With Dojo Peter SvenssonPractical Thin Server Architecture With Dojo Peter Svensson
Practical Thin Server Architecture With Dojo Peter Svenssonrajivmordani
 
A Taste Of InfoGrid
A Taste Of InfoGridA Taste Of InfoGrid
A Taste Of InfoGridInfoGrid.org
 
Vaadin - Rich Web Applications in Server-side Java without Plug-ins or JavaSc...
Vaadin - Rich Web Applications in Server-side Java without Plug-ins or JavaSc...Vaadin - Rich Web Applications in Server-side Java without Plug-ins or JavaSc...
Vaadin - Rich Web Applications in Server-side Java without Plug-ins or JavaSc...Joonas Lehtinen
 
SQL? NoSQL? NewSQL?!? What’s a Java developer to do? - JDC2012 Cairo, Egypt
SQL? NoSQL? NewSQL?!? What’s a Java developer to do? - JDC2012 Cairo, EgyptSQL? NoSQL? NewSQL?!? What’s a Java developer to do? - JDC2012 Cairo, Egypt
SQL? NoSQL? NewSQL?!? What’s a Java developer to do? - JDC2012 Cairo, EgyptChris Richardson
 
Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joo...
Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joo...Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joo...
Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joo...jaxconf
 
Offline capable web applications with Google Gears and Dojo Offline
Offline capable web applications with Google Gears and Dojo OfflineOffline capable web applications with Google Gears and Dojo Offline
Offline capable web applications with Google Gears and Dojo Offlineguestcb5c22
 
Server rendering-talk
Server rendering-talkServer rendering-talk
Server rendering-talkDaiwei Lu
 
Introduction to First Commercial Memcached Service for Cloud
Introduction to First Commercial Memcached Service for CloudIntroduction to First Commercial Memcached Service for Cloud
Introduction to First Commercial Memcached Service for CloudGear6
 

Ähnlich wie Architecture of a Modern Web App - SpringOne India (20)

Building a Single-Page App: Backbone, Node.js, and Beyond
Building a Single-Page App: Backbone, Node.js, and BeyondBuilding a Single-Page App: Backbone, Node.js, and Beyond
Building a Single-Page App: Backbone, Node.js, and Beyond
 
20120802 timisoara
20120802 timisoara20120802 timisoara
20120802 timisoara
 
20120306 dublin js
20120306 dublin js20120306 dublin js
20120306 dublin js
 
Cloud Camp Chicago Dec 2012 - All presentations
Cloud Camp Chicago Dec 2012 - All presentationsCloud Camp Chicago Dec 2012 - All presentations
Cloud Camp Chicago Dec 2012 - All presentations
 
[DSBW Spring 2009] Unit 05: Web Architectures
[DSBW Spring 2009] Unit 05: Web Architectures[DSBW Spring 2009] Unit 05: Web Architectures
[DSBW Spring 2009] Unit 05: Web Architectures
 
Practical Thin Server Architecture With Dojo Sapo Codebits 2008
Practical Thin Server Architecture With Dojo Sapo Codebits 2008Practical Thin Server Architecture With Dojo Sapo Codebits 2008
Practical Thin Server Architecture With Dojo Sapo Codebits 2008
 
Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoo...
Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoo...Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoo...
Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoo...
 
12-factor-jruby
12-factor-jruby12-factor-jruby
12-factor-jruby
 
Talk 03 responsive-web-design
Talk 03 responsive-web-designTalk 03 responsive-web-design
Talk 03 responsive-web-design
 
Client Server 3.0 - 6 Ways JavaScript is Revolutionizing the Client/Server Re...
Client Server 3.0 - 6 Ways JavaScript is Revolutionizing the Client/Server Re...Client Server 3.0 - 6 Ways JavaScript is Revolutionizing the Client/Server Re...
Client Server 3.0 - 6 Ways JavaScript is Revolutionizing the Client/Server Re...
 
Practical Thin Server Architecture With Dojo Peter Svensson
Practical Thin Server Architecture With Dojo Peter SvenssonPractical Thin Server Architecture With Dojo Peter Svensson
Practical Thin Server Architecture With Dojo Peter Svensson
 
Einführung in RavenDB
Einführung in RavenDBEinführung in RavenDB
Einführung in RavenDB
 
Javascript for Wep Apps
Javascript for Wep AppsJavascript for Wep Apps
Javascript for Wep Apps
 
A Taste Of InfoGrid
A Taste Of InfoGridA Taste Of InfoGrid
A Taste Of InfoGrid
 
Vaadin - Rich Web Applications in Server-side Java without Plug-ins or JavaSc...
Vaadin - Rich Web Applications in Server-side Java without Plug-ins or JavaSc...Vaadin - Rich Web Applications in Server-side Java without Plug-ins or JavaSc...
Vaadin - Rich Web Applications in Server-side Java without Plug-ins or JavaSc...
 
SQL? NoSQL? NewSQL?!? What’s a Java developer to do? - JDC2012 Cairo, Egypt
SQL? NoSQL? NewSQL?!? What’s a Java developer to do? - JDC2012 Cairo, EgyptSQL? NoSQL? NewSQL?!? What’s a Java developer to do? - JDC2012 Cairo, Egypt
SQL? NoSQL? NewSQL?!? What’s a Java developer to do? - JDC2012 Cairo, Egypt
 
Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joo...
Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joo...Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joo...
Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joo...
 
Offline capable web applications with Google Gears and Dojo Offline
Offline capable web applications with Google Gears and Dojo OfflineOffline capable web applications with Google Gears and Dojo Offline
Offline capable web applications with Google Gears and Dojo Offline
 
Server rendering-talk
Server rendering-talkServer rendering-talk
Server rendering-talk
 
Introduction to First Commercial Memcached Service for Cloud
Introduction to First Commercial Memcached Service for CloudIntroduction to First Commercial Memcached Service for Cloud
Introduction to First Commercial Memcached Service for Cloud
 

Architecture of a Modern Web App - SpringOne India

  • 1. Architecture of a Modern Web App Jeremy Grelle, SpringSource Staff Engineer Github / Twitter: @jeremyg484 1 Thursday, December 13, 12
  • 2. Overview • Where we’ve been • Where we’re going • How we’ll get there • Questions 2 Thursday, December 13, 12
  • 3. In the beginning... • Sites were static HTML Pros: • low computational overhead • highly cacheable • highly indexable Cons: • hard (easy?) to update • no personalization • usually poor UI 3 Thursday, December 13, 12
  • 4. Let there be CGI • Introduced dynamic generated Pros: pages • dynamic! • selectively cacheable • highly indexable • personalizable Cons: • “high” computational overhead • hard to create • usually poor UI 4 Thursday, December 13, 12
  • 5. LiveScript JavaScript • Dynamic pages Pros: • Lightweight alternative to applets • enhanced usability, maybe • Mostly used for simple scripting • reduced trips to the server – basic form validation – popup ads Cons: – comet cursor trails • abuses annoyed users • business logic often implemented twice: client and server http://en.wikipedia.org/wiki/File:Pop-up_ads.jpg 5 Thursday, December 13, 12
  • 6. AJAX - Web 2.0 • Google Maps sparked Web 2.0 Pros: • GMail • killer UI – required JavaScript • more responsive apps Cons: • difficult to cache • impossible to index • required JavaScript 6 Thursday, December 13, 12
  • 7. Unobtrusive JavaScript • No JavaScript, no problem Pros: • Provide features for user agents • wider compatibility that support them • just as rich UI – fall back to basic HTML • just as responsive Cons: • higher development costs • requires thoughtful engineering 7 Thursday, December 13, 12
  • 8. Client Side Applications • Business logic lives on the client Pros: • Resources and permanent state • reduce server workloads stored on the server • application is highly cacheable • Application state stored on client • extremely rich UI Cons: • content not indexable • requires JavaScript • often requires a ‘modern’ browser 8 Thursday, December 13, 12
  • 9. Overview • Where we’ve been • Where we’re going • How we’ll get there • Questions 9 Thursday, December 13, 12
  • 10. From: server-side apps To: smart clients and services 10 Thursday, December 13, 12
  • 11. Client Browser-based HTML Rendering (progressive Browser enhancement) HTML HTTP View Application Controllers Server Generation Service Layer Channels Repositories RDBMS CRUD Server Thursday, December 13, 12
  • 12. HTML5 & JS Engine Browser app or Client embedded in native DOM Controllers Client-side model web stg Service Layer Channels Repositories RDBMS CRUD Server Thursday, December 13, 12
  • 13. HTML5 & JS Engine Browser app or Client embedded in native DOM Controllers Client-side model web stg JSON HTTP & websockets Service Layer Channels Repositories RDBMS CRUD Server Thursday, December 13, 12
  • 14. HTML5 & JS Engine Browser app or Client embedded in native DOM Controllers Client-side model web stg JSON events HTTP & websockets & notifications Service Layer Channels Repositories RDBMS CRUD Server Thursday, December 13, 12
  • 15. HTML5 & JS Engine Browser app or Client embedded in native DOM Controllers Client-side model web stg JSON events HTTP & websockets & notifications Service Layer Cloud/ Channels Repositories RDBMS PaaS CRUD Thursday, December 13, 12
  • 16. HTML5 & JS Engine Browser app or Client embedded in native DOM Controllers Client-side model web stg JSON events HTTP & websockets & notifications business / Service Service Service domain services Cloud/ Channels Repositories RDBMS PaaS CRUD Thursday, December 13, 12
  • 17. HTML5 & JS Engine Browser app or Client embedded in native DOM Controllers Client-side model web stg JSON events HTTP & websockets & notifications business / Service Service Service domain services Channels Repositories RDBMS CRUD PaaS Thursday, December 13, 12
  • 18. HTML5 & JS Engine Browser app or Client embedded in native DOM Controllers Client-side model web stg JSON events HTTP & websockets & notifications business / Service Service Service domain services PaaS Thursday, December 13, 12
  • 19. HTML5 & JS Engine Browser app or Client embedded in native DOM Controllers Client-side model web stg JSON events HTTP & websockets & notifications business / Service Service Service domain services Service Service Service platform services, web APIs SQL NoSQL Other PaaS Thursday, December 13, 12
  • 20. HTML5 & JS Engine Applications HTML5 (& native) JSON events HTTP & websockets & notifications Services PaaS Thursday, December 13, 12
  • 21. Overview • Where we’ve been • Where we’re going • How we’ll get there • Questions 17 Thursday, December 13, 12
  • 22. Simplify Views • Simple template can render on the client or server – JSP, et al will never render client side • Avoid imperative logic • Lot of conditions may indicate the model is poorly structured • Can the model be cleanly serialized? 18 Thursday, December 13, 12
  • 23. Client side code as a first class citizen • Apply design patterns • Modularize • Unit test • Enforce code quality • See “IoC + JavaScript” coming up next. 19 Thursday, December 13, 12
  • 24. Demo Monty Hall 20 Thursday, December 13, 12
  • 25. Think Messaging • Web Sockets are message based • Web Workers are message based • DOM Events are message based • Web vs Integration is a false dichotomy • See “Going Async - Practical Patterns for Push-Enabled Applications” coming soon to SpringSource YouTube channel. 21 Thursday, December 13, 12
  • 26. Demo Client Server Messaging 22 Thursday, December 13, 12
  • 27. Client vs Server • The definitions of “back-end” and “front-end” are shifting – front-end != client, back-end != server • Embrace both sides • Specialize in client/server integration 23 Thursday, December 13, 12
  • 28. Frameworks • New frameworks are emerging – not quite prime time – watch this space • Frameworks will not solve all your issues – sorry 24 Thursday, December 13, 12
  • 29. Resources • s2js - http://www.github.com/s2js • cujo.js - http://www.cujojs.com • scripted - https://github.com/scripted-editor/scripted • SockJS - http://www.sockjs.org • Monty Hall REST API - https://github.com/acolyer/monty-hall • Monty Hall Client - https://github.com/five-eleven/monty-hall-ui • Messaging Demo - https://github.com/jeremyg484/s12gx-push-service/ 25 Thursday, December 13, 12