SlideShare a Scribd company logo
Rich Web Applications in
Server-side Java without
  Plug-ins or JavaScript
           Joonas Lehtinen, PhD
               Vaadin Ltd - CEO
                   vaadin.com/vaadin

                 @joonaslehtinen
Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen
Vaadin is a
UI framework
 for rich web
 applications
java   html
History behind Vaadin
healthcare portal, >100 kloc of perl,
  89
19
web 1.0, netscape, ie5, ie6, ...
thinking of
object oriented design, desktop, Java, U and I ...
desktop programming paradigm for web!
found         millstone ajax google web toolkit
 00




                          08
         02




                    05
20




        20




                   20



                         20
re-released as
       09
      20
Used by >50.000
                       developers in >150
                       countries

                       Building apps for
                       fortune 500, startups,
                       governments, ...
                       across all industries

                       Collaborating by
                       conributing > 200
                       plug-ins and helping
plug-ins, mainstream   each other on a forum
                       with >1500 posts / m
    10




                11




                       Backed by 50+ person
   20




               20




                       full-time team
see our transparent vaadin.com/roadmap
                         12
                        20
Apache
License
Contents

Server-side                                        Discussion
RIA
What is it? Pros & cons?



                           Vaadin
                           Technology, Features, Getting started
In practice
Coding a Vaadin
application step-by-step
Server-side RIA
“Web 1.0”

Client           5
                                      Server
            HTML Page
DOM      over HttpResponse     View                4


                                                        3
                                          Model

           Parameters over
            HttpRequest
                             Controller
                                               2
                                                       DB
                 1
client-side ria

fat client
Client-side RIA

Client                 4                     Server
                 Requested data
  View             to view as
                  XML / JSON
       5

  DOM                                Model
                                                 3
       1

               Changes to model
Controller   encoded as parameters
                                                      DB
                       2
challenge
  web is
not easy
Refactoring?



                            Compile-
Automated
API docs?   weak typing       time
                            checking?


                Code
             completion?
> 1 developers
                     +
JavaScript
facilitated    weak typing
spaghetti            +
               > 10k SLOC
performance
       browsers
          are      bugs
       different


     features
Google Web Toolkit
Subset of                       IE6
java.lang, java.util

                         Java to     IE7
    Widgetset          JavaScript
                        Compiler
                                    Firefox

Your Application UI                 Safari
simpler
• 100% Java
• Static typing
• Object oriented
• Excellent tooling
less bugs
• Stop debugging
  JavaScript spaghetti
• Ignore most
  browser differences
client-side
• UI in client
• Asyncronous RPC
• Services (for UI)
Building wonderful
apps doesn’t
require writing fat
web clients.
server-side ria

thin client
Server-side RIA

    Client                              8
                                                                                Server
          9                                                            7
              TerminalAdapter




                                                     TerminalAdapter
                                   HTML Page
                                over HttpResponse                            View            6


                                   Automated by                                                   5
    DOM                          the RIA framework                                      Model

Handled by the framework         Parameters over
                                  HttpRequest                              Controller
          1                                                                              4
                                                                       3                         DB
                                        2
High level
              simpler
              • 100% Java
Strong        • Strong typing
              • Object oriented
programming   • Excellent tooling
model

              less bugs
              • No JavaScript debugging
              • Ignore browsers
server enviroment
• Access any library
• Use any language
• Runtime is not
  limited by browser
• Trusted
• Well defined
simplified
communications
• No RPC layer
• No services (for UI)
• Synchronous
• Direct access to
  server API
secure
• Code stays in server
• No services (for UI)
• Predictable runtime
not as scalable
UI state is stored in
the server memory
Measured 12.000
  active concurrent
  users per server
  for a ticketing app
* Amazon EC2-large; 20.622 Ajax requests /
minute peak; limited by storage layer
no offline mode
connection to server
is always required
#1 benefit
development
 is really fast
Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen
2 Java class files
~ 50 LOC + imports
no HTML
no CSS
no JavaScript
no Cut-n-Paste
https://github.com/
jojule/DocumentManager
Vaadin
Framework
Developer
        experience
goals   User
        expecience
        Scalability
123
 ideas
1
amazing
components
User Inteface
Data Source
   Theme
Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen
Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen
Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen
User Inteface
Data Source
   Theme
Reindeer
  Runo
Chameleon
 Custom
User Inteface
Data Source
   Theme
Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen
InMemory, Bean, Method,
Collection, JDBC, JPA,
Hibernate, TextFile,
FileSystem, Properties,
EclipseLink, Lucene,
Mockups, GAE, ... Your’s
example

SQLContainer
Table
or any other UI component


SQLContainer


FreeformQuery

      JDBC

       SELECT * FROM ...
connectionPool =
   new SimpleJDBCConnectionPool(
      "org.hsqldb.jdbc.JDBCDriver",
      "jdbc:hsqldb:mem:sqlcontainer",
      "password", "", 2, 2);
SQLContainer container =
   new SQLContainer(
      new FreeformQuery(
        "SELECT * FROM people",
        Arrays.asList("ID"),
        connectionPool));
Table table = new Table(null, container);
Table
or any other UI component


SQLContainer


TableQuery

      JDBC

        Database Table
• lazy loading
• advanced filtering
• sorting
• connection pooling
• transactions
• optimistic locking
• autocommit mode
• HSQLDB
• MySQL
• PostgreSQL
• Oracle
• MS SQL Server
2
combine power of
• Server-side RIA
• Google Web Toolkit
Layers of abstraction
                   backend frontend
                                                  RPC         browser browser
                    server   server
                   any language   any language   json / xml     java   ➠   javascript
ExtJS GWT Vaadin




                   required       required       optional     optional     optional


                   required       required       required     required     optional


                   required       required       required        X         required
How does it
work, really?
Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen
•   Initial HTML
•   CSS (theme)
•   Images
•   JavaScript

830k total
       compress

250k
       reduced
       widgetset

120k
• name=”Joonas”
• button clicked
150 bytes
Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen
• name=”Joonas”
• button clicked
150 bytes



• Add
  notification
466 bytes
Vaadin UI component
architecture
                             HTTP(S)
“UI Component”                         “Widget”
• Button, Table, Tree, ...             • Client-side peer for
• Server-side data                       the component
• Full Java API                        • Runs on JavaScript




  Java                                  Java

  • Compiled with JDK                   • Google Web Toolkit
Creating new UI
components is
really easy
Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen
Implement two classes

Server-side                            Client-side

 “UI Component”            Automatic    “Widget”
 • Define API                            • Render to DOM
 • Receive client events                • Collect user events
 • Send UI updates
   back
Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen
Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen
Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen
Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen
Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen
Vaadin += GWT
Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen
GWT
Compatible
Serve
         ucr-od
              ize
                    Pr
                    tim
                       Op

                                             f or
                                        ed
      tiv
                                     iz
            df
        or
ity
                                  tim
                               e rol
                                Op
                                  t-


                            s d ont
                             i C
                               ien
                             Cl
Client
        Co
              Op

      -     im   t
     ntr
                                       f or
ol    ize
  df
                             iz   ed          iv ity
or
                          tim          c t
                 sid
                        Op
                                 u
                               od
                          r-
                    e
                         P   r
                       rve
                     Se
Commercial
Support
3
embrace
java
Any JVM
Language
Scalawith Scaladin add-on
val layout =
  new VerticalLayout(width = 100 pct, height = 100 pct) {
      add(new Label(content = "Persons"))
      add(new Table(width = 100 pct, height = 100 pct),
          ratio = 1)
      add(new HorizontalLayout(spacing = true) {
          add(new Button("Edit selected", _ => editClicked()))
          add(new Button("Add new", _ => addNewClicked()))
       })
  }
getMainWindow.setContent(layout)
Internet Explorer
6..
         Chrome
          Firefox
           Safari
           Opera
             iOS
         Android
No
  browser
   plugins
Nothing to
    install
Servlet
      Portlet
(most) clouds
Apache Tomcat, version 4.1 or later
Oracle WebLogic Server, version 9.2 or later
Oracle WebLogic Portal, version 10gR3
IBM WebSphere Application Server, version 6.1 or later
IBM WebSphere Portal, version 6.1 and 7.0
JBoss Application Server, version 3.2.8 or later
Jetty, version 5 or later
Glassfish, version 2 or later
Liferay Portal 5.2 or later
GateIn Portal 3.1
eXo Platform 3
Google App Engine
Vaadin supports Java Servlet API 2.3
 and JSR-168 and JSR-286 Portlet
Specifications and should work with
any Java application server that conforms
to these standards.
Eclipse
IntelliJ IDEA
   Netbeans
       Maven
           Ant
 Spring Roo
            ∙∙∙
Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen
Maven
 mvn archetype:generate
 -DarchetypeGroupId=com.vaadin
 -DarchetypeArtifactId=
   vaadin-archetype-clean

 mvn package          yourproject-1.0.war
getting
started
Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen
vaadin.com/download
vaadin.com/comparison
Download for Free
          vaadin.com/book




     Vaadin is
                a
    for build n open source
              ing mod        J
   look gre          ern web ava framework
             at,            applicat
   your use perform well a           ion
             rs happ        nd make s that
                    y.                you and
    http://va
             adin.com
                     /



SBN 978
        -9   52-92-67
                     53-8
                            90000

9 7 8 95 2
           9    267538
 $29.95




                                                4th Editio
                                                          n




          674 pages
brought to you by...
#85
 Get More Refcardz! Visit refcardz.com


                                         CONTENTS INCLUDE:
                                         About Vaadin


                                                                                   Getting Started with Vaadin
                                         Creating An Application
                                         Components
                                         Layout Components
                                         Themes
                                         Data Binding and more...
                                                                                                                                                            By Marko Grönroos

                                              ABOUT VAADIN                                                         Web
                                                                                                                   Browser                                                              External
                                                                                                                   Client-Side                                                          Resources
                                          Vaadin is a server-side Ajax web application development                 Engine
                                          framework that allows you to build web applications just like                     AJAX Requests

                                          with traditional desktop frameworks, such as AWT or Swing. An                                         Servlet Container
                                                                                                                   Java                                                                 File
                                          application is built from user interface components contained            Servlet                                                              Resources
                                          hierarchically in layout components.
                                                                                                                                                        Data
                                          In the server-driven model, the application code runs on                 Application            UI            Binding     Default
                                                                                                                   Class                  Component                 Theme
                                          a server, while the actual user interaction is handled by a
                                          client-side engine running in the browser. The client-server           Inherits        Events     Changes               Inherits

                                          communications and any client-side technologies, such as                 User             Event        Data              Application   Application
                                          HTML and JavaScript, are invisible to the developer. As the              Application      Listener     Model             Themes        Resources
                                          client-side engine runs as JavaScript in the browser, there is no
                                          need to install plug-ins. Vaadin is released under the Apache                                            Database
                                          License 2.0.
                                           Web             Java         Vaadin          Your             Web    Figure 2: Architecture for Vaadin Applications
                                           Browser         Web          UI              Java          Service
                                           Client-Side     Server       Components      Application
                                                                                                                                  You can get a reference to the application object
 .dzone.com




                                           Engine                                                        EJB          Hot
                                                                                                                      Tip         from any component attached to the application with
                                                                                                          DB

                                                                                                                Event Listeners
                                          Figure 1: Vaadin Client-Server Architecture
                                                                                                                In the event-driven model, user interaction with user interface
                                          If the built-in selection of components is not enough, you can
                                                                                                                components triggers server-side events, which you can handle
Questions?
Comments?


joonas@vaadin.com
  vaadin.com/joonas
    @joonaslehtinen
            #vaadin    Expert services
                                       Better
                       Online support
                                       Results
                              Training
 Slides available on                   Faster
         slideshare             Tools

                              vaadin.com/pro

More Related Content

PDF
Vaadin - Rich Web Applications in Server-side Java without Plug-ins or JavaSc...
PDF
Professional Frontend Engineering
PDF
Ajax In Enterprise Portals Wesley Hales
PDF
Crx 2.2 Deep-Dive
PDF
CQ 5.4 Deep-Dive
PPTX
Web Apps atop a Content Repository
PDF
Optimizing HTML5 Sites with CQ5/WEM
PDF
JavaOne 2010 Keynote
Vaadin - Rich Web Applications in Server-side Java without Plug-ins or JavaSc...
Professional Frontend Engineering
Ajax In Enterprise Portals Wesley Hales
Crx 2.2 Deep-Dive
CQ 5.4 Deep-Dive
Web Apps atop a Content Repository
Optimizing HTML5 Sites with CQ5/WEM
JavaOne 2010 Keynote

What's hot (20)

PDF
Java keynote preso
PDF
Developer’s intro to the alfresco platform
PDF
Java EE 8 Recipes
PDF
[English version] JavaFX and Web Integration
PDF
Java EE 8 Web Frameworks: A Look at JSF vs MVC
PPTX
Social Photos - My presentation at Microsoft Tech Day
PDF
JavaOne 2011: Migrating Spring Applications to Java EE 6
PDF
Ajax World Oct2008 Jrd
PDF
Egl Rui Ajax World
PDF
Cloud Computing2
PDF
Introducing WebLogic 12c OTN Tour 2012
PDF
Three WEM Dev Tricks
PDF
jsf2 Notes
PDF
HTML5 Refresher
PDF
Drive dam
PDF
Web Technologies in Java EE 7
DOC
Santosh_Resume_Java
PPT
AK 3 web services using apache axis
PPT
Was 5.1 To 6.1 Updated
PPTX
RESTful Web Services
Java keynote preso
Developer’s intro to the alfresco platform
Java EE 8 Recipes
[English version] JavaFX and Web Integration
Java EE 8 Web Frameworks: A Look at JSF vs MVC
Social Photos - My presentation at Microsoft Tech Day
JavaOne 2011: Migrating Spring Applications to Java EE 6
Ajax World Oct2008 Jrd
Egl Rui Ajax World
Cloud Computing2
Introducing WebLogic 12c OTN Tour 2012
Three WEM Dev Tricks
jsf2 Notes
HTML5 Refresher
Drive dam
Web Technologies in Java EE 7
Santosh_Resume_Java
AK 3 web services using apache axis
Was 5.1 To 6.1 Updated
RESTful Web Services
Ad

Viewers also liked (16)

PDF
JSF2 Composite Components - Ian Hlavats
PDF
Architecting Android Apps: Marko Gargenta
PDF
The Evolution of Java Persistence in EclipseLink: Shaun Smith
PDF
MVC on the Server and on the Client: How to Integrate Spring MVC and Backbone...
PDF
From Tomcat to Java EE, making the transition with TomEE
PDF
Understanding Java Garbage Collection and What You Can Do About It: Gil Tene
PDF
What you need to know about Lambdas - Jamie Allen
PDF
Building an Impenetrable ZooKeeper - Kathleen Ting
PDF
Getting started with Websocket and Server-sent Events using Java - Arun Gupta
PDF
The Spring 4 Update - Josh Long
PPTX
The New Reality: the Role of PaaS in Technology Innovation - Franklin Herbas
PDF
Future of the Web - Yehuda Katz
PPT
The economies of scaling software - Abdel Remani
PDF
Multi Client Development with Spring - Josh Long
PDF
Java PaaS Comparisons - Khanderao Kand
PDF
Apache Hadoop and its role in Big Data architecture - Himanshu Bari
JSF2 Composite Components - Ian Hlavats
Architecting Android Apps: Marko Gargenta
The Evolution of Java Persistence in EclipseLink: Shaun Smith
MVC on the Server and on the Client: How to Integrate Spring MVC and Backbone...
From Tomcat to Java EE, making the transition with TomEE
Understanding Java Garbage Collection and What You Can Do About It: Gil Tene
What you need to know about Lambdas - Jamie Allen
Building an Impenetrable ZooKeeper - Kathleen Ting
Getting started with Websocket and Server-sent Events using Java - Arun Gupta
The Spring 4 Update - Josh Long
The New Reality: the Role of PaaS in Technology Innovation - Franklin Herbas
Future of the Web - Yehuda Katz
The economies of scaling software - Abdel Remani
Multi Client Development with Spring - Josh Long
Java PaaS Comparisons - Khanderao Kand
Apache Hadoop and its role in Big Data architecture - Himanshu Bari
Ad

Similar to Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen (20)

PDF
Architecture of a Modern Web App - SpringOne India
PDF
Modern Architectures with Spring and JavaScript
PDF
Grails and the World of Tomorrow
PDF
Sencha Web Applications Come of Age
PDF
Building Cross Platform Mobile Web Apps
PPTX
MobiWebApp 2012 - Gaps between standard & tool for native and web mobile appl...
PPTX
A great api is hard to find
PDF
Modern Architectures with Spring and JavaScript
PPTX
WebBee rapid web app development teck stack
PPTX
The Magic's in the Glue: Daniela Florescu Presentation on XQuery and the Cloud
PDF
PDF
Experiences on a Design Approach for Interactive Web Applications
PPTX
Designing a play framework application
PDF
Lecture: Vaadin Overview
PDF
Web frameworks
KEY
RIA with Flex & PHP - Tulsa TechFest 2009
PDF
Building i pad apps in pure java with vaadin
PDF
What is Google App Engine?
PDF
Activiti & Vaddin
PDF
Rails, ExtJs, and Netzke
Architecture of a Modern Web App - SpringOne India
Modern Architectures with Spring and JavaScript
Grails and the World of Tomorrow
Sencha Web Applications Come of Age
Building Cross Platform Mobile Web Apps
MobiWebApp 2012 - Gaps between standard & tool for native and web mobile appl...
A great api is hard to find
Modern Architectures with Spring and JavaScript
WebBee rapid web app development teck stack
The Magic's in the Glue: Daniela Florescu Presentation on XQuery and the Cloud
Experiences on a Design Approach for Interactive Web Applications
Designing a play framework application
Lecture: Vaadin Overview
Web frameworks
RIA with Flex & PHP - Tulsa TechFest 2009
Building i pad apps in pure java with vaadin
What is Google App Engine?
Activiti & Vaddin
Rails, ExtJs, and Netzke

Recently uploaded (20)

PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
A Presentation on Artificial Intelligence
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
KodekX | Application Modernization Development
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Modernizing your data center with Dell and AMD
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
Spectral efficient network and resource selection model in 5G networks
Review of recent advances in non-invasive hemoglobin estimation
NewMind AI Weekly Chronicles - August'25 Week I
A Presentation on Artificial Intelligence
Diabetes mellitus diagnosis method based random forest with bat algorithm
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
The AUB Centre for AI in Media Proposal.docx
KodekX | Application Modernization Development
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Mobile App Security Testing_ A Comprehensive Guide.pdf
Modernizing your data center with Dell and AMD
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Big Data Technologies - Introduction.pptx
Encapsulation_ Review paper, used for researhc scholars
Reach Out and Touch Someone: Haptics and Empathic Computing
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
20250228 LYD VKU AI Blended-Learning.pptx
Digital-Transformation-Roadmap-for-Companies.pptx
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Per capita expenditure prediction using model stacking based on satellite ima...

Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen

  • 1. Rich Web Applications in Server-side Java without Plug-ins or JavaScript Joonas Lehtinen, PhD Vaadin Ltd - CEO vaadin.com/vaadin @joonaslehtinen
  • 3. Vaadin is a UI framework for rich web applications
  • 4. java html
  • 6. healthcare portal, >100 kloc of perl, 89 19
  • 7. web 1.0, netscape, ie5, ie6, ...
  • 8. thinking of object oriented design, desktop, Java, U and I ...
  • 10. found millstone ajax google web toolkit 00 08 02 05 20 20 20 20
  • 11. re-released as 09 20
  • 12. Used by >50.000 developers in >150 countries Building apps for fortune 500, startups, governments, ... across all industries Collaborating by conributing > 200 plug-ins and helping plug-ins, mainstream each other on a forum with >1500 posts / m 10 11 Backed by 50+ person 20 20 full-time team
  • 13. see our transparent vaadin.com/roadmap 12 20
  • 15. Contents Server-side Discussion RIA What is it? Pros & cons? Vaadin Technology, Features, Getting started In practice Coding a Vaadin application step-by-step
  • 17. “Web 1.0” Client 5 Server HTML Page DOM over HttpResponse View 4 3 Model Parameters over HttpRequest Controller 2 DB 1
  • 19. Client-side RIA Client 4 Server Requested data View to view as XML / JSON 5 DOM Model 3 1 Changes to model Controller encoded as parameters DB 2
  • 20. challenge web is not easy
  • 21. Refactoring? Compile- Automated API docs? weak typing time checking? Code completion?
  • 22. > 1 developers + JavaScript facilitated weak typing spaghetti + > 10k SLOC
  • 23. performance browsers are bugs different features
  • 25. Subset of IE6 java.lang, java.util Java to IE7 Widgetset JavaScript Compiler Firefox Your Application UI Safari
  • 26. simpler • 100% Java • Static typing • Object oriented • Excellent tooling
  • 27. less bugs • Stop debugging JavaScript spaghetti • Ignore most browser differences
  • 28. client-side • UI in client • Asyncronous RPC • Services (for UI)
  • 29. Building wonderful apps doesn’t require writing fat web clients.
  • 31. Server-side RIA Client 8 Server 9 7 TerminalAdapter TerminalAdapter HTML Page over HttpResponse View 6 Automated by 5 DOM the RIA framework Model Handled by the framework Parameters over HttpRequest Controller 1 4 3 DB 2
  • 32. High level simpler • 100% Java Strong • Strong typing • Object oriented programming • Excellent tooling model less bugs • No JavaScript debugging • Ignore browsers
  • 33. server enviroment • Access any library • Use any language • Runtime is not limited by browser • Trusted • Well defined
  • 34. simplified communications • No RPC layer • No services (for UI) • Synchronous • Direct access to server API
  • 35. secure • Code stays in server • No services (for UI) • Predictable runtime
  • 36. not as scalable UI state is stored in the server memory
  • 37. Measured 12.000 active concurrent users per server for a ticketing app * Amazon EC2-large; 20.622 Ajax requests / minute peak; limited by storage layer
  • 38. no offline mode connection to server is always required
  • 41. 2 Java class files ~ 50 LOC + imports no HTML no CSS no JavaScript no Cut-n-Paste
  • 44. Developer experience goals User expecience Scalability
  • 55. InMemory, Bean, Method, Collection, JDBC, JPA, Hibernate, TextFile, FileSystem, Properties, EclipseLink, Lucene, Mockups, GAE, ... Your’s
  • 57. Table or any other UI component SQLContainer FreeformQuery JDBC SELECT * FROM ...
  • 58. connectionPool = new SimpleJDBCConnectionPool( "org.hsqldb.jdbc.JDBCDriver", "jdbc:hsqldb:mem:sqlcontainer", "password", "", 2, 2); SQLContainer container = new SQLContainer( new FreeformQuery( "SELECT * FROM people", Arrays.asList("ID"), connectionPool)); Table table = new Table(null, container);
  • 59. Table or any other UI component SQLContainer TableQuery JDBC Database Table
  • 60. • lazy loading • advanced filtering • sorting • connection pooling • transactions • optimistic locking • autocommit mode
  • 61. • HSQLDB • MySQL • PostgreSQL • Oracle • MS SQL Server
  • 62. 2 combine power of • Server-side RIA • Google Web Toolkit
  • 63. Layers of abstraction backend frontend RPC browser browser server server any language any language json / xml java ➠ javascript ExtJS GWT Vaadin required required optional optional optional required required required required optional required required required X required
  • 64. How does it work, really?
  • 66. Initial HTML • CSS (theme) • Images • JavaScript 830k total compress 250k reduced widgetset 120k
  • 67. • name=”Joonas” • button clicked 150 bytes
  • 69. • name=”Joonas” • button clicked 150 bytes • Add notification 466 bytes
  • 70. Vaadin UI component architecture HTTP(S) “UI Component” “Widget” • Button, Table, Tree, ... • Client-side peer for • Server-side data the component • Full Java API • Runs on JavaScript Java Java • Compiled with JDK • Google Web Toolkit
  • 71. Creating new UI components is really easy
  • 73. Implement two classes Server-side Client-side “UI Component” Automatic “Widget” • Define API • Render to DOM • Receive client events • Collect user events • Send UI updates back
  • 82. Serve ucr-od ize Pr tim Op f or ed tiv iz df or ity tim e rol Op t- s d ont i C ien Cl
  • 83. Client Co Op - im t ntr f or ol ize df iz ed iv ity or tim c t sid Op u od r- e P r rve Se
  • 87. Scalawith Scaladin add-on val layout = new VerticalLayout(width = 100 pct, height = 100 pct) { add(new Label(content = "Persons")) add(new Table(width = 100 pct, height = 100 pct), ratio = 1) add(new HorizontalLayout(spacing = true) { add(new Button("Edit selected", _ => editClicked())) add(new Button("Add new", _ => addNewClicked())) }) } getMainWindow.setContent(layout)
  • 88. Internet Explorer 6.. Chrome Firefox Safari Opera iOS Android
  • 89. No browser plugins Nothing to install
  • 90. Servlet Portlet (most) clouds
  • 91. Apache Tomcat, version 4.1 or later Oracle WebLogic Server, version 9.2 or later Oracle WebLogic Portal, version 10gR3 IBM WebSphere Application Server, version 6.1 or later IBM WebSphere Portal, version 6.1 and 7.0 JBoss Application Server, version 3.2.8 or later Jetty, version 5 or later Glassfish, version 2 or later Liferay Portal 5.2 or later GateIn Portal 3.1 eXo Platform 3 Google App Engine Vaadin supports Java Servlet API 2.3 and JSR-168 and JSR-286 Portlet Specifications and should work with any Java application server that conforms to these standards.
  • 92. Eclipse IntelliJ IDEA Netbeans Maven Ant Spring Roo ∙∙∙
  • 94. Maven mvn archetype:generate -DarchetypeGroupId=com.vaadin -DarchetypeArtifactId= vaadin-archetype-clean mvn package yourproject-1.0.war
  • 99. Download for Free vaadin.com/book Vaadin is a for build n open source ing mod J look gre ern web ava framework at, applicat your use perform well a ion rs happ nd make s that y. you and http://va adin.com / SBN 978 -9 52-92-67 53-8 90000 9 7 8 95 2 9 267538 $29.95 4th Editio n 674 pages
  • 100. brought to you by... #85 Get More Refcardz! Visit refcardz.com CONTENTS INCLUDE: About Vaadin Getting Started with Vaadin Creating An Application Components Layout Components Themes Data Binding and more... By Marko Grönroos ABOUT VAADIN Web Browser External Client-Side Resources Vaadin is a server-side Ajax web application development Engine framework that allows you to build web applications just like AJAX Requests with traditional desktop frameworks, such as AWT or Swing. An Servlet Container Java File application is built from user interface components contained Servlet Resources hierarchically in layout components. Data In the server-driven model, the application code runs on Application UI Binding Default Class Component Theme a server, while the actual user interaction is handled by a client-side engine running in the browser. The client-server Inherits Events Changes Inherits communications and any client-side technologies, such as User Event Data Application Application HTML and JavaScript, are invisible to the developer. As the Application Listener Model Themes Resources client-side engine runs as JavaScript in the browser, there is no need to install plug-ins. Vaadin is released under the Apache Database License 2.0. Web Java Vaadin Your Web Figure 2: Architecture for Vaadin Applications Browser Web UI Java Service Client-Side Server Components Application You can get a reference to the application object .dzone.com Engine EJB Hot Tip from any component attached to the application with DB Event Listeners Figure 1: Vaadin Client-Server Architecture In the event-driven model, user interaction with user interface If the built-in selection of components is not enough, you can components triggers server-side events, which you can handle
  • 101. Questions? Comments? joonas@vaadin.com vaadin.com/joonas @joonaslehtinen #vaadin Expert services Better Online support Results Training Slides available on Faster slideshare Tools vaadin.com/pro