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

                 @joonaslehtinen
Rich Web Applications in
Server-side Java without
  Plug-ins or JavaScript
           Joonas Lehtinen, PhD
               Vaadin Ltd - CEO
                   vaadin.com/vaadin

                 @joonaslehtinen
?
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
Š National Geographic Channel 2010




Seeing is believing
What we can do
in 20 minutes?
2 Java class files
50 LOC + imports
no HTML
no CSS
no JavaScript
no Cut-n-Paste
Vaadin
Framework
Developer
        experience
goals   User
        expecience
        Scalability
123
 ideas
1
amazing
components
User Inteface
Data Source
   Theme
User Inteface
Data Source
   Theme
Reindeer
  Runo
Chameleon
 Custom
User Inteface
Data Source
   Theme
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?
•   Initial HTML
•   CSS (theme)
•   Images
•   JavaScript

830k total
       compress

250k
       reduced
       widgetset

120k
• name=”Joonas”
• button clicked
150 bytes
• 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
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
PaperStack notes = new PaperStack();
!
! @Override
! public void init() {

        // === Layout ========================================================
!   !   HorizontalLayout lo= new HorizontalLayout();
!   !   Window mainWindow = new Window("Postitnotes Application", lo);
!   !   lo.setSizeFull();
!   !   lo.addComponent(notes);
!   !   lo.setComponentAlignment(notes, Alignment.MIDDLE_CENTER);
!   !   setMainWindow(mainWindow);!!
!   !   notes.setWidth("350px");
!   !   notes.setHeight("350px");
!   !
        // === Note 1 ========================================================
! !     notes.addComponent(new Label("<h1>TODO / Today</h1><div style='font-size: 24px'>” +
           “<p>Enjoy the conference...</p></div>", Label.CONTENT_XHTML), "#fef49c");

        // === Note 2 ========================================================
! !     notes.addComponent(new Label("<h1>TODO / Tomorrow</h1><div style='font-size: 24px'>” +
           “<p>Learn Vaadin!</p></div>", Label.CONTENT_XHTML), "#b2ffa1");

        // === Note 3 ========================================================
! !     notes.addComponent(new Label("<div style='font-size: 60px'><center><br/><br/><br/>” +
           “DOUBLE<br/><br/><br/>SPEED</center></div>", Label.CONTENT_XHTML), "#b2ffa1");

        // === Note 4 ========================================================
!   !   com.vaadin.ui.RichTextArea rta = new RichTextArea();
!   !   rta.setSizeFull();
!   !   notes.addComponent(rta);
!   !   rta.setValue("<span style='font-size: 35pt; color: green;'>You can use any “ +
           “Vaadin components here...</span>");
! }
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
Glasssh, 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
Specications and should work with
any Java application server that conforms
to these standards.
Eclipse
IntelliJ IDEA
   Netbeans
       Maven
           Ant
 Spring Roo
            ∙∙∙
Maven
 mvn archetype:generate
 -DarchetypeGroupId=com.vaadin
 -DarchetypeArtifactId=
   vaadin-archetype-clean

 mvn package          yourproject-1.0.war
PROD
UCTIV
persistence setup --provider HIBERNATE
 --database HYPERSONIC_IN_MEMORY

entity --class ~.domain.Topping
eld string --eldName name --notNull

entity --class ~.domain.Pizza
eld number --eldName price
 --type java.lang.Float
eld set --eldName toppings
 --type ~.domain.Topping
vaadin setup
 --applicationPackage ~.web
 --baseName PizzaShop
 --themeName pizza
 --useJpaContainer false

vaadin generate all
 --package ~.web.ui
 --visuallyComposable true
eld string --class ~.domain.Pizza
  --notNull --eldName name --sizeMin 3
getting
started
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
$43
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



            vaadin. com/joonas
              @ joonaslehtinen
                       #vaadin

More Related Content

What's hot

Frank Mantek Google G Data
Frank Mantek Google G DataFrank Mantek Google G Data
Frank Mantek Google G Data
deimos
 
Dave Carroll Application Services Salesforce
Dave Carroll Application Services SalesforceDave Carroll Application Services Salesforce
Dave Carroll Application Services Salesforce
deimos
 
ibm websphere admin training | websphere admin course | ibm websphere adminis...
ibm websphere admin training | websphere admin course | ibm websphere adminis...ibm websphere admin training | websphere admin course | ibm websphere adminis...
ibm websphere admin training | websphere admin course | ibm websphere adminis...
Nancy Thomas
 
Was 5.1 To 6.1 Updated
Was 5.1 To 6.1 UpdatedWas 5.1 To 6.1 Updated
Was 5.1 To 6.1 Updated
tsmanyam
 
Gregor Hohpe Track Intro The Cloud As Middle Ware
Gregor Hohpe Track Intro The Cloud As Middle WareGregor Hohpe Track Intro The Cloud As Middle Ware
Gregor Hohpe Track Intro The Cloud As Middle Ware
deimos
 
Three WEM Dev Tricks
Three WEM Dev TricksThree WEM Dev Tricks
Three WEM Dev Tricks
Gabriel Walt
 

What's hot (20)

Frank Mantek Google G Data
Frank Mantek Google G DataFrank Mantek Google G Data
Frank Mantek Google G Data
 
JavaOne 2010 Keynote
JavaOne 2010 Keynote JavaOne 2010 Keynote
JavaOne 2010 Keynote
 
Websphere interview Questions
Websphere interview QuestionsWebsphere interview Questions
Websphere interview Questions
 
Introducing WebLogic 12c OTN Tour 2012
Introducing WebLogic 12c OTN Tour 2012Introducing WebLogic 12c OTN Tour 2012
Introducing WebLogic 12c OTN Tour 2012
 
Developer’s intro to the alfresco platform
Developer’s intro to the alfresco platformDeveloper’s intro to the alfresco platform
Developer’s intro to the alfresco platform
 
Dave Carroll Application Services Salesforce
Dave Carroll Application Services SalesforceDave Carroll Application Services Salesforce
Dave Carroll Application Services Salesforce
 
Java ee introduction
Java ee introductionJava ee introduction
Java ee introduction
 
Ibm web sphere_job_interview_preparation_guide
Ibm web sphere_job_interview_preparation_guideIbm web sphere_job_interview_preparation_guide
Ibm web sphere_job_interview_preparation_guide
 
IBM WebSphere Application Server Update - Technical University (March 2015)
IBM WebSphere Application Server Update - Technical University (March 2015)IBM WebSphere Application Server Update - Technical University (March 2015)
IBM WebSphere Application Server Update - Technical University (March 2015)
 
JBoss EAP / WildFly, State of the Union
JBoss EAP / WildFly, State of the UnionJBoss EAP / WildFly, State of the Union
JBoss EAP / WildFly, State of the Union
 
IBM Websphere introduction and installation for beginners
IBM Websphere introduction and installation for beginnersIBM Websphere introduction and installation for beginners
IBM Websphere introduction and installation for beginners
 
ibm websphere admin training | websphere admin course | ibm websphere adminis...
ibm websphere admin training | websphere admin course | ibm websphere adminis...ibm websphere admin training | websphere admin course | ibm websphere adminis...
ibm websphere admin training | websphere admin course | ibm websphere adminis...
 
Large Scale Migration from WebLogic to JBoss
Large Scale Migration from WebLogic to JBossLarge Scale Migration from WebLogic to JBoss
Large Scale Migration from WebLogic to JBoss
 
Was 5.1 To 6.1 Updated
Was 5.1 To 6.1 UpdatedWas 5.1 To 6.1 Updated
Was 5.1 To 6.1 Updated
 
RESTful Web Services
RESTful Web ServicesRESTful Web Services
RESTful Web Services
 
Drive dam
Drive damDrive dam
Drive dam
 
Websphere Application Server v7
Websphere Application Server v7Websphere Application Server v7
Websphere Application Server v7
 
Websphere Application Server V8.5
Websphere Application Server V8.5Websphere Application Server V8.5
Websphere Application Server V8.5
 
Gregor Hohpe Track Intro The Cloud As Middle Ware
Gregor Hohpe Track Intro The Cloud As Middle WareGregor Hohpe Track Intro The Cloud As Middle Ware
Gregor Hohpe Track Intro The Cloud As Middle Ware
 
Three WEM Dev Tricks
Three WEM Dev TricksThree WEM Dev Tricks
Three WEM Dev Tricks
 

Similar to Vaadin - Rich Web Applications in Server-side Java without Plug-ins or JavaScript

vFabric - Ideal Platform for SaaS Apps
vFabric - Ideal Platform for SaaS AppsvFabric - Ideal Platform for SaaS Apps
vFabric - Ideal Platform for SaaS Apps
VMware vFabric
 
20120306 dublin js
20120306 dublin js20120306 dublin js
20120306 dublin js
Richard Rodger
 
Uni Paa S Overview
Uni Paa S  OverviewUni Paa S  Overview
Uni Paa S Overview
Arik
 
Web前端性能分析工具导引
Web前端性能分析工具导引Web前端性能分析工具导引
Web前端性能分析工具导引
冰 郭
 
Ajax World Oct2008 Jrd
Ajax World Oct2008 JrdAjax World Oct2008 Jrd
Ajax World Oct2008 Jrd
rajivmordani
 
Anvita Gita Supersite Case Study Nov2000
Anvita   Gita Supersite Case Study Nov2000Anvita   Gita Supersite Case Study Nov2000
Anvita Gita Supersite Case Study Nov2000
guest6e7a1b1
 
Дмитрий Тежельников «Разработка вэб-решений с использованием Asp.NET.Core и ...
Дмитрий Тежельников  «Разработка вэб-решений с использованием Asp.NET.Core и ...Дмитрий Тежельников  «Разработка вэб-решений с использованием Asp.NET.Core и ...
Дмитрий Тежельников «Разработка вэб-решений с использованием Asp.NET.Core и ...
MskDotNet Community
 
Wakanda - apps.berlin.js - 2012-11-29
Wakanda - apps.berlin.js - 2012-11-29Wakanda - apps.berlin.js - 2012-11-29
Wakanda - apps.berlin.js - 2012-11-29
Alexandre Morgaut
 
Java EE 與 雲端運算的展望
Java EE 與 雲端運算的展望 Java EE 與 雲端運算的展望
Java EE 與 雲端運算的展望
javatwo2011
 
JAX 2012: Moderne Architektur mit Spring und JavaScript
JAX 2012: Moderne Architektur mit Spring und JavaScriptJAX 2012: Moderne Architektur mit Spring und JavaScript
JAX 2012: Moderne Architektur mit Spring und JavaScript
martinlippert
 
Writing & Using Web Services
Writing & Using Web ServicesWriting & Using Web Services
Writing & Using Web Services
Rajarshi Guha
 
20120802 timisoara
20120802 timisoara20120802 timisoara
20120802 timisoara
Richard Rodger
 
WebSphere Portal Technical Overview
WebSphere Portal Technical OverviewWebSphere Portal Technical Overview
WebSphere Portal Technical Overview
Vincent Perrin
 

Similar to Vaadin - Rich Web Applications in Server-side Java without Plug-ins or JavaScript (20)

vFabric - Ideal Platform for SaaS Apps
vFabric - Ideal Platform for SaaS AppsvFabric - Ideal Platform for SaaS Apps
vFabric - Ideal Platform for SaaS Apps
 
20120306 dublin js
20120306 dublin js20120306 dublin js
20120306 dublin js
 
Uni Paa S Overview
Uni Paa S  OverviewUni Paa S  Overview
Uni Paa S Overview
 
Web前端性能分析工具导引
Web前端性能分析工具导引Web前端性能分析工具导引
Web前端性能分析工具导引
 
Ajax World Oct2008 Jrd
Ajax World Oct2008 JrdAjax World Oct2008 Jrd
Ajax World Oct2008 Jrd
 
Anvita Gita Supersite Case Study Nov2000
Anvita   Gita Supersite Case Study Nov2000Anvita   Gita Supersite Case Study Nov2000
Anvita Gita Supersite Case Study Nov2000
 
Node Summit 2016: Web App Architectures
Node Summit 2016:  Web App ArchitecturesNode Summit 2016:  Web App Architectures
Node Summit 2016: Web App Architectures
 
Дмитрий Тежельников «Разработка вэб-решений с использованием Asp.NET.Core и ...
Дмитрий Тежельников  «Разработка вэб-решений с использованием Asp.NET.Core и ...Дмитрий Тежельников  «Разработка вэб-решений с использованием Asp.NET.Core и ...
Дмитрий Тежельников «Разработка вэб-решений с использованием Asp.NET.Core и ...
 
IBM Connect 2017: Your Data In the Major Leagues: A Practical Guide to REST S...
IBM Connect 2017: Your Data In the Major Leagues: A Practical Guide to REST S...IBM Connect 2017: Your Data In the Major Leagues: A Practical Guide to REST S...
IBM Connect 2017: Your Data In the Major Leagues: A Practical Guide to REST S...
 
A look ahead at RAP (ESE 2010)
A look ahead at RAP (ESE 2010)A look ahead at RAP (ESE 2010)
A look ahead at RAP (ESE 2010)
 
Server rendering-talk
Server rendering-talkServer rendering-talk
Server rendering-talk
 
Wakanda - apps.berlin.js - 2012-11-29
Wakanda - apps.berlin.js - 2012-11-29Wakanda - apps.berlin.js - 2012-11-29
Wakanda - apps.berlin.js - 2012-11-29
 
Java EE 與 雲端運算的展望
Java EE 與 雲端運算的展望 Java EE 與 雲端運算的展望
Java EE 與 雲端運算的展望
 
qooxdoo - Open Source Ajax Framework
qooxdoo - Open Source Ajax Frameworkqooxdoo - Open Source Ajax Framework
qooxdoo - Open Source Ajax Framework
 
ASP.NET MVC Performance
ASP.NET MVC PerformanceASP.NET MVC Performance
ASP.NET MVC Performance
 
JAX 2012: Moderne Architektur mit Spring und JavaScript
JAX 2012: Moderne Architektur mit Spring und JavaScriptJAX 2012: Moderne Architektur mit Spring und JavaScript
JAX 2012: Moderne Architektur mit Spring und JavaScript
 
Intro in JavaEE world (TU Olomouc)
Intro in JavaEE world (TU Olomouc)Intro in JavaEE world (TU Olomouc)
Intro in JavaEE world (TU Olomouc)
 
Writing & Using Web Services
Writing & Using Web ServicesWriting & Using Web Services
Writing & Using Web Services
 
20120802 timisoara
20120802 timisoara20120802 timisoara
20120802 timisoara
 
WebSphere Portal Technical Overview
WebSphere Portal Technical OverviewWebSphere Portal Technical Overview
WebSphere Portal Technical Overview
 

More from Joonas Lehtinen

Notes on architecture
Notes on architectureNotes on architecture
Notes on architecture
Joonas Lehtinen
 
Vaadin roadmap-devoxx-2013
Vaadin roadmap-devoxx-2013Vaadin roadmap-devoxx-2013
Vaadin roadmap-devoxx-2013
Joonas Lehtinen
 
Vaadin7 modern-web-apps-in-java
Vaadin7 modern-web-apps-in-javaVaadin7 modern-web-apps-in-java
Vaadin7 modern-web-apps-in-java
Joonas Lehtinen
 

More from Joonas Lehtinen (20)

Web Components for Java Developers
Web Components for Java DevelopersWeb Components for Java Developers
Web Components for Java Developers
 
Vaadin Components @ Angular U
Vaadin Components @ Angular UVaadin Components @ Angular U
Vaadin Components @ Angular U
 
Vaadin & Web Components
Vaadin & Web ComponentsVaadin & Web Components
Vaadin & Web Components
 
Vaadin Components
Vaadin ComponentsVaadin Components
Vaadin Components
 
Vaadin Introduction, 7.3 edition
Vaadin Introduction, 7.3 editionVaadin Introduction, 7.3 edition
Vaadin Introduction, 7.3 edition
 
Hybrid webinar
Hybrid webinarHybrid webinar
Hybrid webinar
 
Vaadin 7.2
Vaadin 7.2Vaadin 7.2
Vaadin 7.2
 
Vaadin intro
Vaadin introVaadin intro
Vaadin intro
 
Vaadin intro at GWT.create conference
Vaadin intro at GWT.create conferenceVaadin intro at GWT.create conference
Vaadin intro at GWT.create conference
 
Hybrid applications
Hybrid applicationsHybrid applications
Hybrid applications
 
Notes on architecture
Notes on architectureNotes on architecture
Notes on architecture
 
Vaadin roadmap-devoxx-2013
Vaadin roadmap-devoxx-2013Vaadin roadmap-devoxx-2013
Vaadin roadmap-devoxx-2013
 
Beoynd Vaadin 7
Beoynd Vaadin 7Beoynd Vaadin 7
Beoynd Vaadin 7
 
Vaadin 7
Vaadin 7Vaadin 7
Vaadin 7
 
Vaadin7
Vaadin7Vaadin7
Vaadin7
 
Hackathon - Building vaadin add on components
Hackathon - Building vaadin add on componentsHackathon - Building vaadin add on components
Hackathon - Building vaadin add on components
 
Vaadin7
Vaadin7Vaadin7
Vaadin7
 
Vaadin today and tomorrow
Vaadin today and tomorrowVaadin today and tomorrow
Vaadin today and tomorrow
 
Migration from vaadin 6 to vaadin 7 devoxx france 2013
Migration from vaadin 6 to vaadin 7   devoxx france 2013Migration from vaadin 6 to vaadin 7   devoxx france 2013
Migration from vaadin 6 to vaadin 7 devoxx france 2013
 
Vaadin7 modern-web-apps-in-java
Vaadin7 modern-web-apps-in-javaVaadin7 modern-web-apps-in-java
Vaadin7 modern-web-apps-in-java
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 

Vaadin - Rich Web Applications in Server-side Java without Plug-ins or JavaScript

  • 1. Rich Web Applications in Server-side Java without Plug-ins or JavaScript Joonas Lehtinen, PhD Vaadin Ltd - CEO vaadin.com/vaadin @joonaslehtinen
  • 2. Rich Web Applications in Server-side Java without Plug-ins or JavaScript Joonas Lehtinen, PhD Vaadin Ltd - CEO vaadin.com/vaadin @joonaslehtinen
  • 3. ?
  • 4.
  • 5. Vaadin is a UI framework for rich web applications
  • 6. java html
  • 8. healthcare portal, >100 kloc of perl, 89 19
  • 9. web 1.0, netscape, ie5, ie6, ...
  • 10. thinking of object oriented design, desktop, Java, U and I ...
  • 12. found millstone ajax google web toolkit 00 08 02 05 20 20 20 20
  • 13. re-released as 09 20
  • 14. 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
  • 15. see our transparent vaadin.com/roadmap 12 20
  • 17. Contents Server-side Discussion RIA What is it? Pros & cons? Vaadin Technology, Features, Getting started In practice Coding a Vaadin application step-by-step
  • 19. “Web 1.0” Client 5 Server HTML Page DOM over HttpResponse View 4 3 Model Parameters over HttpRequest Controller 2 DB 1
  • 21. 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
  • 22. challenge web is not easy
  • 23. Refactoring? Compile- Automated API docs? weak typing time checking? Code completion?
  • 24. > 1 developers + JavaScript facilitated weak typing spaghetti + > 10k SLOC
  • 25. performance browsers are bugs different features
  • 27. Subset of IE6 java.lang, java.util Java to IE7 Widgetset JavaScript Compiler Firefox Your Application UI Safari
  • 28. simpler • 100% Java • Static typing • Object oriented • Excellent tooling
  • 29. less bugs • Stop debugging JavaScript spaghetti • Ignore most browser differences
  • 30. client-side • UI in client • Asyncronous RPC • Services (for UI)
  • 33. 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
  • 34. High level simpler • 100% Java Strong • Strong typing • Object oriented programming • Excellent tooling model less bugs • No JavaScript debugging • Ignore browsers
  • 35. server enviroment • Access any library • Use any language • Runtime is not limited by browser • Trusted • Well defined
  • 36. simplified communications • No RPC layer • No services (for UI) • Synchronous • Direct access to server API
  • 37. secure • Code stays in server • No services (for UI) • Predictable runtime
  • 38. not as scalable UI state is stored in the server memory
  • 39. 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
  • 40. no offline mode connection to server is always required
  • 42. Š National Geographic Channel 2010 Seeing is believing
  • 43. What we can do in 20 minutes?
  • 44.
  • 45.
  • 46.
  • 47. 2 Java class files 50 LOC + imports no HTML no CSS no JavaScript no Cut-n-Paste
  • 49. Developer experience goals User expecience Scalability
  • 53.
  • 54.
  • 58.
  • 59. InMemory, Bean, Method, Collection, JDBC, JPA, Hibernate, TextFile, FileSystem, Properties, EclipseLink, Lucene, Mockups, GAE, ... Your’s
  • 61. Table or any other UI component SQLContainer FreeformQuery JDBC SELECT * FROM ...
  • 62. 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);
  • 63. Table or any other UI component SQLContainer TableQuery JDBC Database Table
  • 64. • lazy loading • advanced filtering • sorting • connection pooling • transactions • optimistic locking • autocommit mode
  • 65. • HSQLDB • MySQL • PostgreSQL • Oracle • MS SQL Server
  • 66. 2 combine power of • Server-side RIA • Google Web Toolkit
  • 67. 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
  • 68. How does it work, really?
  • 69.
  • 70. • Initial HTML • CSS (theme) • Images • JavaScript 830k total compress 250k reduced widgetset 120k
  • 72.
  • 73. • name=”Joonas” • button clicked 150 bytes • Add notification 466 bytes
  • 74. 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
  • 75. Creating new UI components is really easy
  • 76.
  • 77. Implement two classes Server-side Client-side “UI Component” Automatic “Widget” • Dene API • Render to DOM • Receive client events • Collect user events • Send UI updates back
  • 78.
  • 79.
  • 80.
  • 81.
  • 82.
  • 83.
  • 84. PaperStack notes = new PaperStack(); ! ! @Override ! public void init() { // === Layout ======================================================== ! ! HorizontalLayout lo= new HorizontalLayout(); ! ! Window mainWindow = new Window("Postitnotes Application", lo); ! ! lo.setSizeFull(); ! ! lo.addComponent(notes); ! ! lo.setComponentAlignment(notes, Alignment.MIDDLE_CENTER); ! ! setMainWindow(mainWindow);!! ! ! notes.setWidth("350px"); ! ! notes.setHeight("350px"); ! ! // === Note 1 ======================================================== ! ! notes.addComponent(new Label("<h1>TODO / Today</h1><div style='font-size: 24px'>” + “<p>Enjoy the conference...</p></div>", Label.CONTENT_XHTML), "#fef49c"); // === Note 2 ======================================================== ! ! notes.addComponent(new Label("<h1>TODO / Tomorrow</h1><div style='font-size: 24px'>” + “<p>Learn Vaadin!</p></div>", Label.CONTENT_XHTML), "#b2ffa1"); // === Note 3 ======================================================== ! ! notes.addComponent(new Label("<div style='font-size: 60px'><center><br/><br/><br/>” + “DOUBLE<br/><br/><br/>SPEED</center></div>", Label.CONTENT_XHTML), "#b2ffa1"); // === Note 4 ======================================================== ! ! com.vaadin.ui.RichTextArea rta = new RichTextArea(); ! ! rta.setSizeFull(); ! ! notes.addComponent(rta); ! ! rta.setValue("<span style='font-size: 35pt; color: green;'>You can use any “ + “Vaadin components here...</span>"); ! }
  • 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 Glasssh, 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 Specications and should work with any Java application server that conforms to these standards.
  • 92. Eclipse IntelliJ IDEA Netbeans Maven Ant Spring Roo ∙∙∙
  • 93.
  • 94. Maven mvn archetype:generate -DarchetypeGroupId=com.vaadin -DarchetypeArtifactId= vaadin-archetype-clean mvn package yourproject-1.0.war
  • 96.
  • 97. persistence setup --provider HIBERNATE --database HYPERSONIC_IN_MEMORY entity --class ~.domain.Topping eld string --eldName name --notNull entity --class ~.domain.Pizza eld number --eldName price --type java.lang.Float eld set --eldName toppings --type ~.domain.Topping
  • 98.
  • 99.
  • 100. vaadin setup --applicationPackage ~.web --baseName PizzaShop --themeName pizza --useJpaContainer false vaadin generate all --package ~.web.ui --visuallyComposable true
  • 101.
  • 102.
  • 103.
  • 104.
  • 105.
  • 106. eld string --class ~.domain.Pizza --notNull --eldName name --sizeMin 3
  • 107.
  • 109.
  • 112. 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
  • 113. $43
  • 114. 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
  • 115.
  • 116. Questions Comments vaadin. com/joonas @ joonaslehtinen #vaadin