SlideShare a Scribd company logo
1 of 37
Download to read offline
HTML5 with
                     Vaadin and Scala
                         Joonas Lehtinen, PhD
                             Vaadin Ltd - CEO
                                 vaadin.com/vaadin

                               @joonaslehtinen




24. maaliskuuta 12
Contents

        HTML5                              Building the app
        • Canvas




                     Vaadin
                     • How does it work?


        Scala

24. maaliskuuta 12
24. maaliskuuta 12
<!doctype html>



24. maaliskuuta 12
Element       Description
                     <article>     An independent piece of content for a document e.g. blog entry,
                                   forum entry

                     <aside>       A piece of content that is somehow related to the rest of the page

                     <audio>       Audio media content

                     <canvas>      A component for rendering dynamic bitmap graphics on the fly.
                                   e.g games

                     <command>     A command that the user can invoke: a button, radio button or checkbox

                     <datalist>    Together with the new list attribute for the <input> element can be used
                                   to make combo boxes

                     <details>     Additional information or controls that the user can obtain on demand, to
                                   provide details on the document, or parts of it

                     <embed>       Used for plug-in content

                     <figure>       A piece of self-contained flow content referenced as a single unit from the
                                   main flow of the document

                     <figcaption>   Caption for a

                     <footer>      Footer for a section; may contain information about author, copyright
                                   information, etc.

                     <header>      A group of introductory or navigation aids

                     <hgroup>      Header of a section

                     <keygen>      A key pair generation control for user authentication in forms

                     <mark>        A run of text in one document marker or highlighted for reference purposes

24. maaliskuuta 12
Cross-document                CSS3
        messaging                                Document
                                                  editing
     Multimedia
                                                Microdata
        WebGL

              Offline storage
                                                  Canvas
    Markup
 improvements                                    History
                                               management
                     Forms

    Geolocation                Drag-and-drop     File API
24. maaliskuuta 12
Canvas




                     state



24. maaliskuuta 12
http://vj.jole.fi/



24. maaliskuuta 12
brought to you by...

                     #151




                      Get More Refcardz! Visit refcardz.com
                                                              CONTENTS INCLUDE:
                                                               Introduction to Canvas
                                                                                                                                                                          HTML 5 Canvas
                                                               A Comparison with SVG
                                                               Canvas Performance
                                                               Creating a Canvas and More!                                                                                                                                   By Simon Sarris


                                                                  INTRODUCTION TO CANVAS

                                                              The HTML <canvas> element allows for on-the-fly creation of graphs,                                       Canvas                                   SVG
                                                              diagrams, games, and other visual elements and interactive media. It also
                                                                                                                                                           Support                                                                               -
                                                              allows for the rendering of 2D and 3D shapes and images, typically via
                                                                                                                                                                       Safari, Firefox, and Opera have at       ers. Almost all modern smart phones.
                                                              JavaScript.
                                                                                                                                                                       least some support. Internet Explorer
                                                                                                                                                                       9+ has support. Almost all modern
                                                               <canvas id=”canvas1” width=”500” height=”500”></canvas>                                                 smart phones.
                                                               <script type=”text/javascript”>
                                                               var can = document.getElementById(‘canvas1’);                                                           limited support through the excanvas
                                                               var ctx = can.getContext(‘2d’);
                                                                                                                                                                       library.
                                                                           “Hello World!”, 50, 50);
                                                               </script>
                                                                                                                                                           Stateful-
                                                                                                                                                           ness        surface                                  surface
                                                              Canvas is perhaps the most visible part of the new HTML5 feature set,
                                                              with new demos, projects, and proofs of concept appearing daily.                                         remembered about their state.

                                                              Canvas is a very low-level drawing surface with commands for making                          Other
                                                                                                                                                           Consider-                                            10,000 objects.
                                                              lines, curves, rectangles, gradients and clipping regions built in. There is                 ations
                                                              very little else in the way of graphics drawing, which allows programmers                                must be programmed yourself.
                                                              to create their own methods for several basic drawing functions such                                                                              objects, statefulness is built in and
                                                              as blurring, tweening, and animation. Even drawing a dotted line is                                      (rendering nothing) if scripting is      event handling is much easier.
                                                              something that must be done by the programmer from scratch.                                              disabled.
                                                                                                                                                                                                                many programs such as Illustrator can
                                                              Canvas is an immediate drawing surface and has no scene graph. This                                                                               output SVG
                                                              means that once an image or shape is drawn to it, neither the Canvas nor
                                                              its drawing context have any knowledge of what was just drawn.                                                                                    animation.

                                                                                                                                                           Accessi-
                                                              For instance, to draw a line and have it move around, you need to do                         bility      DOM objects                              objects.
                                                              much more than simply change the points of the line. You must clear
                                                              the Canvas (or part of it) and redraw the line with the new points. This                                                                    -     and web crawlers.
                                                              contrasts greatly with SVG, where you would simply give the line a new                                   ment functionality is strongly advised
                                                              position and be done with it.                                                                            against, even in the specification
                                                                                                                                                                       itself.

                                                                             You can visit the evolving specification for Canvas at the WHATWG site:
                                                                   Hot       http://www.whatwg.org/specs/web-apps/current-work/multipage/
                                                                                                                                                                       disabled.

                                                                   Tip       the-canvas-element.html.



                                                              Browser Support and Hardware Acceleration
                                                              Canvas is supported by Firefox 1.5 and later; Opera 9 and later; and
                                                              newer versions of Safari, Chrome, and Internet Explorer 9 and 10.

                                                              The latest versions of these browsers support nearly all abilities of the
                                                              Canvas element. A notable exception is drawFocusRing, which no
                                                              browser supports effects.

                                                              Hardware acceleration is supported in some variation by all current
                                                              browsers, though the performance gains differ. It is difficult to benchmark
                                                              between the modern browsers because they are changing frequently, but
                                                              so far IE9 seems to consistently get the most out of having a good GPU.
                     HTML5 Canvas




                                                              On a machine with a good video card it is almost always the fastest at
                                                              rendering massive amounts of images or canvas-to-canvas draws.

                                                              Accelerated IE9 also renders fillRect more than twice as fast as the other
                                                              major browsers, allowing for impressive 2D particle effects [1]. Chrome
                                                              often has the fastest path rendering but can be inconsistent between
                                                              releases. All browsers render images and rects much faster than paths or
                                                              text, so it is best to use images and rects if you can regardless of which
                                                              browsers you are targeting.



                                                                                                                                       DZone, Inc.    |   www.dzone.com




24. maaliskuuta 12
Scala

24. maaliskuuta 12
Scala is ...
                       A multiparadigm language created by
                       Martin Odersky from Typesafe


                       Object-oriented: every value is an object
                       Functional: every function is a value

                       Java compatible: Runs on the JVM and
                       integrates with Java tools and
                       technologies



24. maaliskuuta 12
24. maaliskuuta 12
24. maaliskuuta 12
Concise
                      Java: 349 lines
                     Scala: 130 lines


24. maaliskuuta 12
Statically typed
                  with amazing
                 type inference


24. maaliskuuta 12
24. maaliskuuta 12
24. maaliskuuta 12
24. maaliskuuta 12
Vaadin is a
                     UI framework
                      for rich web
                      applications


24. maaliskuuta 12
java      html

24. maaliskuuta 12
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


 24. maaliskuuta 12
Vaadin UI component
    architecture
                                       HTTP(S)
          Server UI comp.                        Client UI comp.
          • Button, Table, Tree, ...             • Rendering
          • API you program with                 • Event handling
          • State                                • Runs on JavaScript




               Java                              Java

               • Compiled with JDK               • Google Web Toolkit



24. maaliskuuta 12
Vaadin UI component
    architecture
                                       HTTP(S)
          Server UI comp.                        Client UI comp.
          • Button, Table, Tree, ...             • Rendering
          • API you program with                 • Event handling
          • State                                • Runs on JavaScript




               Java                              Java

               • Compiled with JDK               • Google Web Toolkit



24. maaliskuuta 12
How does it
                 work, really?


24. maaliskuuta 12
24. maaliskuuta 12
•   Initial HTML
                     •   CSS (theme)
                     •   Images
                     •   JavaScript

                     120k total




24. maaliskuuta 12
• name=”Joonas”
                     • button clicked
                     150 bytes




24. maaliskuuta 12
24. maaliskuuta 12
• name=”Joonas”
                     • button clicked
                     150 bytes



                     • Add
                       notification
                     466 bytes

24. maaliskuuta 12
24. maaliskuuta 12
24. maaliskuuta 12
24. maaliskuuta 12
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
   24. maaliskuuta 12
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
   w.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
24. maaliskuuta 12 develop new components with the Google Web Toolkit (GWT)
24. maaliskuuta 12
https://github.com/
                     jojule/Stocks


24. maaliskuuta 12
Questions?
             Comments?
               joonas@vaadin.com
                 vaadin.com/joonas
                   @joonaslehtinen
                           #vaadin

                                           Expert services
                                                           Better
                                           Online support
                                                           Results
                     15.50                        Training
                     Aula N13                              Faster
                     Vaadin intro                   Tools
                     • More about Vaadin
                     • In Java
                                                  vaadin.com/pro

24. maaliskuuta 12

More Related Content

What's hot

Moving To The Client - JavaFX and HTML5
Moving To The Client - JavaFX and HTML5Moving To The Client - JavaFX and HTML5
Moving To The Client - JavaFX and HTML5Stephen Chin
 
Moving to the Client - JavaFX and HTML5
Moving to the Client - JavaFX and HTML5Moving to the Client - JavaFX and HTML5
Moving to the Client - JavaFX and HTML5Stephen Chin
 
JavaFX Versus HTML5 - JavaOne 2014
JavaFX Versus HTML5 - JavaOne 2014JavaFX Versus HTML5 - JavaOne 2014
JavaFX Versus HTML5 - JavaOne 2014Ryan Cuprak
 
Moving to the Client - JavaFX and HTML5 (PowerPoint Version)
Moving to the Client - JavaFX and HTML5 (PowerPoint Version)Moving to the Client - JavaFX and HTML5 (PowerPoint Version)
Moving to the Client - JavaFX and HTML5 (PowerPoint Version)Stephen Chin
 
Micronaut: Changing the Micro Future
Micronaut: Changing the Micro FutureMicronaut: Changing the Micro Future
Micronaut: Changing the Micro FutureZachary Klein
 
Wicket Introduction
Wicket IntroductionWicket Introduction
Wicket IntroductionEyal Golan
 
Wicket Presentation @ AlphaCSP Java Web Frameworks Playoff 2008
Wicket Presentation @ AlphaCSP Java Web Frameworks Playoff 2008Wicket Presentation @ AlphaCSP Java Web Frameworks Playoff 2008
Wicket Presentation @ AlphaCSP Java Web Frameworks Playoff 2008Baruch Sadogursky
 
Apache Wicket Web Framework
Apache Wicket Web FrameworkApache Wicket Web Framework
Apache Wicket Web FrameworkLuther Baker
 
Web Components for Java Developers
Web Components for Java DevelopersWeb Components for Java Developers
Web Components for Java DevelopersJoonas Lehtinen
 
Vaadin 7 CN
Vaadin 7 CNVaadin 7 CN
Vaadin 7 CNjojule
 
Front End Development for Back End Java Developers - NYJavaSIG 2019
Front End Development for Back End Java Developers - NYJavaSIG 2019Front End Development for Back End Java Developers - NYJavaSIG 2019
Front End Development for Back End Java Developers - NYJavaSIG 2019Matt Raible
 
Web components with java by Haijian Wang
Web components with java by Haijian WangWeb components with java by Haijian Wang
Web components with java by Haijian WangGWTcon
 
The Modern Java Web Developer - JavaOne 2013
The Modern Java Web Developer - JavaOne 2013The Modern Java Web Developer - JavaOne 2013
The Modern Java Web Developer - JavaOne 2013Matt Raible
 
webcomponents (Jfokus 2015)
webcomponents (Jfokus 2015)webcomponents (Jfokus 2015)
webcomponents (Jfokus 2015)Hendrik Ebbers
 
Workshop: Building Vaadin add-ons
Workshop: Building Vaadin add-onsWorkshop: Building Vaadin add-ons
Workshop: Building Vaadin add-onsSami Ekblad
 
Wicket Next (1.4/1.5)
Wicket Next (1.4/1.5)Wicket Next (1.4/1.5)
Wicket Next (1.4/1.5)jcompagner
 

What's hot (20)

Moving To The Client - JavaFX and HTML5
Moving To The Client - JavaFX and HTML5Moving To The Client - JavaFX and HTML5
Moving To The Client - JavaFX and HTML5
 
Moving to the Client - JavaFX and HTML5
Moving to the Client - JavaFX and HTML5Moving to the Client - JavaFX and HTML5
Moving to the Client - JavaFX and HTML5
 
JavaFX Versus HTML5 - JavaOne 2014
JavaFX Versus HTML5 - JavaOne 2014JavaFX Versus HTML5 - JavaOne 2014
JavaFX Versus HTML5 - JavaOne 2014
 
React Vs AnagularJS
React Vs AnagularJSReact Vs AnagularJS
React Vs AnagularJS
 
Moving to the Client - JavaFX and HTML5 (PowerPoint Version)
Moving to the Client - JavaFX and HTML5 (PowerPoint Version)Moving to the Client - JavaFX and HTML5 (PowerPoint Version)
Moving to the Client - JavaFX and HTML5 (PowerPoint Version)
 
Micronaut: Changing the Micro Future
Micronaut: Changing the Micro FutureMicronaut: Changing the Micro Future
Micronaut: Changing the Micro Future
 
Wicket Introduction
Wicket IntroductionWicket Introduction
Wicket Introduction
 
Wicket Presentation @ AlphaCSP Java Web Frameworks Playoff 2008
Wicket Presentation @ AlphaCSP Java Web Frameworks Playoff 2008Wicket Presentation @ AlphaCSP Java Web Frameworks Playoff 2008
Wicket Presentation @ AlphaCSP Java Web Frameworks Playoff 2008
 
Wicket 2010
Wicket 2010Wicket 2010
Wicket 2010
 
Apache Wicket Web Framework
Apache Wicket Web FrameworkApache Wicket Web Framework
Apache Wicket Web Framework
 
Web Components for Java Developers
Web Components for Java DevelopersWeb Components for Java Developers
Web Components for Java Developers
 
Vaadin 7 CN
Vaadin 7 CNVaadin 7 CN
Vaadin 7 CN
 
Front End Development for Back End Java Developers - NYJavaSIG 2019
Front End Development for Back End Java Developers - NYJavaSIG 2019Front End Development for Back End Java Developers - NYJavaSIG 2019
Front End Development for Back End Java Developers - NYJavaSIG 2019
 
Web components with java by Haijian Wang
Web components with java by Haijian WangWeb components with java by Haijian Wang
Web components with java by Haijian Wang
 
The State of Wicket
The State of WicketThe State of Wicket
The State of Wicket
 
Micronaut Launchpad
Micronaut LaunchpadMicronaut Launchpad
Micronaut Launchpad
 
The Modern Java Web Developer - JavaOne 2013
The Modern Java Web Developer - JavaOne 2013The Modern Java Web Developer - JavaOne 2013
The Modern Java Web Developer - JavaOne 2013
 
webcomponents (Jfokus 2015)
webcomponents (Jfokus 2015)webcomponents (Jfokus 2015)
webcomponents (Jfokus 2015)
 
Workshop: Building Vaadin add-ons
Workshop: Building Vaadin add-onsWorkshop: Building Vaadin add-ons
Workshop: Building Vaadin add-ons
 
Wicket Next (1.4/1.5)
Wicket Next (1.4/1.5)Wicket Next (1.4/1.5)
Wicket Next (1.4/1.5)
 

Similar to Html5 with Vaadin and Scala

Desingning reusable web components
Desingning reusable web componentsDesingning reusable web components
Desingning reusable web componentsJoonas Lehtinen
 
Desingning reusable web components
Desingning reusable web componentsDesingning reusable web components
Desingning reusable web componentsjojule
 
Desingning reusable web components
Desingning reusable web componentsDesingning reusable web components
Desingning reusable web componentsJoonas Lehtinen
 
Rich Media Advertising with SVG and JavaScript
Rich Media Advertising with SVG and JavaScriptRich Media Advertising with SVG and JavaScript
Rich Media Advertising with SVG and JavaScriptGjokica Zafirovski
 
Professional reports with SVG
Professional reports with SVGProfessional reports with SVG
Professional reports with SVGSpeedPartner GmbH
 
Joy of Inkscape - at StixCamp
Joy of Inkscape - at StixCampJoy of Inkscape - at StixCamp
Joy of Inkscape - at StixCampDonna Benjamin
 
Canvas Based Presentation - Zeroth Review
Canvas Based Presentation - Zeroth ReviewCanvas Based Presentation - Zeroth Review
Canvas Based Presentation - Zeroth ReviewArvind Krishnaa
 
Wordcamp Thessaloniki 2011 The Nextweb
Wordcamp Thessaloniki 2011 The NextwebWordcamp Thessaloniki 2011 The Nextweb
Wordcamp Thessaloniki 2011 The NextwebGeorge Kanellopoulos
 
Dynamic User Interfaces for Desktop and Mobile
Dynamic User Interfaces for Desktop and MobileDynamic User Interfaces for Desktop and Mobile
Dynamic User Interfaces for Desktop and Mobilepeychevi
 
WordCamp Thessaloniki2011 The NextWeb
WordCamp Thessaloniki2011 The NextWebWordCamp Thessaloniki2011 The NextWeb
WordCamp Thessaloniki2011 The NextWebGeorge Kanellopoulos
 
HTML5: An Introduction To Next Generation Web Development
HTML5: An Introduction To Next Generation Web DevelopmentHTML5: An Introduction To Next Generation Web Development
HTML5: An Introduction To Next Generation Web DevelopmentTilak Joshi
 
Web Apps and more
Web Apps and moreWeb Apps and more
Web Apps and moreYan Shi
 
Web app and more
Web app and moreWeb app and more
Web app and morefaming su
 

Similar to Html5 with Vaadin and Scala (20)

Desingning reusable web components
Desingning reusable web componentsDesingning reusable web components
Desingning reusable web components
 
Desingning reusable web components
Desingning reusable web componentsDesingning reusable web components
Desingning reusable web components
 
Desingning reusable web components
Desingning reusable web componentsDesingning reusable web components
Desingning reusable web components
 
HTML5 - A Whirlwind tour
HTML5 - A Whirlwind tourHTML5 - A Whirlwind tour
HTML5 - A Whirlwind tour
 
Html5 more than just html5 v final
Html5  more than just html5 v finalHtml5  more than just html5 v final
Html5 more than just html5 v final
 
Rich Media Advertising with SVG and JavaScript
Rich Media Advertising with SVG and JavaScriptRich Media Advertising with SVG and JavaScript
Rich Media Advertising with SVG and JavaScript
 
Professional reports with SVG
Professional reports with SVGProfessional reports with SVG
Professional reports with SVG
 
Html5
Html5Html5
Html5
 
Joy of Inkscape - at StixCamp
Joy of Inkscape - at StixCampJoy of Inkscape - at StixCamp
Joy of Inkscape - at StixCamp
 
Canvas Based Presentation - Zeroth Review
Canvas Based Presentation - Zeroth ReviewCanvas Based Presentation - Zeroth Review
Canvas Based Presentation - Zeroth Review
 
Media queries
Media queriesMedia queries
Media queries
 
Wordcamp Thessaloniki 2011 The Nextweb
Wordcamp Thessaloniki 2011 The NextwebWordcamp Thessaloniki 2011 The Nextweb
Wordcamp Thessaloniki 2011 The Nextweb
 
Dynamic User Interfaces for Desktop and Mobile
Dynamic User Interfaces for Desktop and MobileDynamic User Interfaces for Desktop and Mobile
Dynamic User Interfaces for Desktop and Mobile
 
WordCamp Thessaloniki2011 The NextWeb
WordCamp Thessaloniki2011 The NextWebWordCamp Thessaloniki2011 The NextWeb
WordCamp Thessaloniki2011 The NextWeb
 
HTML5: An Introduction To Next Generation Web Development
HTML5: An Introduction To Next Generation Web DevelopmentHTML5: An Introduction To Next Generation Web Development
HTML5: An Introduction To Next Generation Web Development
 
Html5
Html5Html5
Html5
 
Word camp nextweb
Word camp nextwebWord camp nextweb
Word camp nextweb
 
Word camp nextweb
Word camp nextwebWord camp nextweb
Word camp nextweb
 
Web Apps and more
Web Apps and moreWeb Apps and more
Web Apps and more
 
Web app and more
Web app and moreWeb app and more
Web app and more
 

More from Joonas Lehtinen

More from Joonas Lehtinen (20)

Hybrid webinar
Hybrid webinarHybrid webinar
Hybrid webinar
 
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
 
Vaadin 7 Today and Tomorrow
Vaadin 7 Today and TomorrowVaadin 7 Today and Tomorrow
Vaadin 7 Today and Tomorrow
 
Vaadin 7
Vaadin 7Vaadin 7
Vaadin 7
 
Lecture: Vaadin Overview
Lecture: Vaadin OverviewLecture: Vaadin Overview
Lecture: Vaadin Overview
 
Vaadin 7
Vaadin 7Vaadin 7
Vaadin 7
 
Vaadin 7 what next
Vaadin 7   what nextVaadin 7   what next
Vaadin 7 what next
 
Client-Server Hybrid Apps with Vaadin
Client-Server Hybrid Apps with VaadinClient-Server Hybrid Apps with Vaadin
Client-Server Hybrid Apps with Vaadin
 

Recently uploaded

Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 

Recently uploaded (20)

Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 

Html5 with Vaadin and Scala

  • 1. HTML5 with Vaadin and Scala Joonas Lehtinen, PhD Vaadin Ltd - CEO vaadin.com/vaadin @joonaslehtinen 24. maaliskuuta 12
  • 2. Contents HTML5 Building the app • Canvas Vaadin • How does it work? Scala 24. maaliskuuta 12
  • 5. Element Description <article> An independent piece of content for a document e.g. blog entry, forum entry <aside> A piece of content that is somehow related to the rest of the page <audio> Audio media content <canvas> A component for rendering dynamic bitmap graphics on the fly. e.g games <command> A command that the user can invoke: a button, radio button or checkbox <datalist> Together with the new list attribute for the <input> element can be used to make combo boxes <details> Additional information or controls that the user can obtain on demand, to provide details on the document, or parts of it <embed> Used for plug-in content <figure> A piece of self-contained flow content referenced as a single unit from the main flow of the document <figcaption> Caption for a <footer> Footer for a section; may contain information about author, copyright information, etc. <header> A group of introductory or navigation aids <hgroup> Header of a section <keygen> A key pair generation control for user authentication in forms <mark> A run of text in one document marker or highlighted for reference purposes 24. maaliskuuta 12
  • 6. Cross-document CSS3 messaging Document editing Multimedia Microdata WebGL Offline storage Canvas Markup improvements History management Forms Geolocation Drag-and-drop File API 24. maaliskuuta 12
  • 7. Canvas state 24. maaliskuuta 12
  • 9. brought to you by... #151 Get More Refcardz! Visit refcardz.com CONTENTS INCLUDE: Introduction to Canvas HTML 5 Canvas A Comparison with SVG Canvas Performance Creating a Canvas and More! By Simon Sarris INTRODUCTION TO CANVAS The HTML <canvas> element allows for on-the-fly creation of graphs, Canvas SVG diagrams, games, and other visual elements and interactive media. It also Support - allows for the rendering of 2D and 3D shapes and images, typically via Safari, Firefox, and Opera have at ers. Almost all modern smart phones. JavaScript. least some support. Internet Explorer 9+ has support. Almost all modern <canvas id=”canvas1” width=”500” height=”500”></canvas> smart phones. <script type=”text/javascript”> var can = document.getElementById(‘canvas1’); limited support through the excanvas var ctx = can.getContext(‘2d’); library. “Hello World!”, 50, 50); </script> Stateful- ness surface surface Canvas is perhaps the most visible part of the new HTML5 feature set, with new demos, projects, and proofs of concept appearing daily. remembered about their state. Canvas is a very low-level drawing surface with commands for making Other Consider- 10,000 objects. lines, curves, rectangles, gradients and clipping regions built in. There is ations very little else in the way of graphics drawing, which allows programmers must be programmed yourself. to create their own methods for several basic drawing functions such objects, statefulness is built in and as blurring, tweening, and animation. Even drawing a dotted line is (rendering nothing) if scripting is event handling is much easier. something that must be done by the programmer from scratch. disabled. many programs such as Illustrator can Canvas is an immediate drawing surface and has no scene graph. This output SVG means that once an image or shape is drawn to it, neither the Canvas nor its drawing context have any knowledge of what was just drawn. animation. Accessi- For instance, to draw a line and have it move around, you need to do bility DOM objects objects. much more than simply change the points of the line. You must clear the Canvas (or part of it) and redraw the line with the new points. This - and web crawlers. contrasts greatly with SVG, where you would simply give the line a new ment functionality is strongly advised position and be done with it. against, even in the specification itself. You can visit the evolving specification for Canvas at the WHATWG site: Hot http://www.whatwg.org/specs/web-apps/current-work/multipage/ disabled. Tip the-canvas-element.html. Browser Support and Hardware Acceleration Canvas is supported by Firefox 1.5 and later; Opera 9 and later; and newer versions of Safari, Chrome, and Internet Explorer 9 and 10. The latest versions of these browsers support nearly all abilities of the Canvas element. A notable exception is drawFocusRing, which no browser supports effects. Hardware acceleration is supported in some variation by all current browsers, though the performance gains differ. It is difficult to benchmark between the modern browsers because they are changing frequently, but so far IE9 seems to consistently get the most out of having a good GPU. HTML5 Canvas On a machine with a good video card it is almost always the fastest at rendering massive amounts of images or canvas-to-canvas draws. Accelerated IE9 also renders fillRect more than twice as fast as the other major browsers, allowing for impressive 2D particle effects [1]. Chrome often has the fastest path rendering but can be inconsistent between releases. All browsers render images and rects much faster than paths or text, so it is best to use images and rects if you can regardless of which browsers you are targeting. DZone, Inc. | www.dzone.com 24. maaliskuuta 12
  • 11. Scala is ... A multiparadigm language created by Martin Odersky from Typesafe Object-oriented: every value is an object Functional: every function is a value Java compatible: Runs on the JVM and integrates with Java tools and technologies 24. maaliskuuta 12
  • 14. Concise Java: 349 lines Scala: 130 lines 24. maaliskuuta 12
  • 15. Statically typed with amazing type inference 24. maaliskuuta 12
  • 19. Vaadin is a UI framework for rich web applications 24. maaliskuuta 12
  • 20. java html 24. maaliskuuta 12
  • 21. 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 24. maaliskuuta 12
  • 22. Vaadin UI component architecture HTTP(S) Server UI comp. Client UI comp. • Button, Table, Tree, ... • Rendering • API you program with • Event handling • State • Runs on JavaScript Java Java • Compiled with JDK • Google Web Toolkit 24. maaliskuuta 12
  • 23. Vaadin UI component architecture HTTP(S) Server UI comp. Client UI comp. • Button, Table, Tree, ... • Rendering • API you program with • Event handling • State • Runs on JavaScript Java Java • Compiled with JDK • Google Web Toolkit 24. maaliskuuta 12
  • 24. How does it work, really? 24. maaliskuuta 12
  • 26. Initial HTML • CSS (theme) • Images • JavaScript 120k total 24. maaliskuuta 12
  • 27. • name=”Joonas” • button clicked 150 bytes 24. maaliskuuta 12
  • 29. • name=”Joonas” • button clicked 150 bytes • Add notification 466 bytes 24. maaliskuuta 12
  • 33. 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 24. maaliskuuta 12
  • 34. 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 w.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 24. maaliskuuta 12 develop new components with the Google Web Toolkit (GWT)
  • 36. https://github.com/ jojule/Stocks 24. maaliskuuta 12
  • 37. Questions? Comments? joonas@vaadin.com vaadin.com/joonas @joonaslehtinen #vaadin Expert services Better Online support Results 15.50 Training Aula N13 Faster Vaadin intro Tools • More about Vaadin • In Java vaadin.com/pro 24. maaliskuuta 12