SlideShare une entreprise Scribd logo
1  sur  92
Télécharger pour lire hors ligne
Designing Reusable
  Web Components
          Dr. Joonas Lehtinen
                      Vaadin

              @joonaslehtinen
Agenda

What do we                            Q&A
want to
design?

                      Designing Web Component
Technology            Step-by-step
•HTML5 / Canvas
•Google Web Toolkit
•Vaadin Framework
Goal
1
Goal
http://jole.virtuallypreinstalled.com/spreadsheet
2
Technology
<!doctype html>
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
“new shiny”
Cross-document          CSS3
   messaging                          Document
                                       editing
Multimedia
                                     Microdata
 WebGL

   Offline storage
                                       Canvas
   Markup
improvements                          History
                                    management
          Forms

Geolocation         Drag-and-drop     File API
Canvas



  state

  state

  state
http://vj.jole.fi/
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
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)
Vaadin is a
UI framework
 for rich web
 applications
java   html
Web application layers
         Backend      Web                   Java to
                                RPC                     JavaScript
          server     server                JavaScript
Vaadin




          required   required   optional     optional     optional
GWT




          required   required   required     required     optional
JS




          required   required   required                  required
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
How does it
work, really?
•   Initial HTML
•   CSS (theme)
•   Images
•   JavaScript

250k total
• name=”Joonas”
• button clicked
150 bytes
• name=”Joonas”
• button clicked
150 bytes



• Add
  notification
466 bytes
http://demo.vaadin.com/
        dashboard
Download for Free
       vaadin.com/book




Java fra
         me
pplicatio work
         ns that
d make
        you and




00 0




       ~700 pages
Designing
Step-by-step
3
Designing
Step-by-step
Need
 We can not get
the UX we need
with the existing
         widgets
Goals
• List of
• real
• quantifiable
• requirements
• for UX
Example goals
  • Load and view data in XLS files
  • Show visual overview for numeric cols
  • Must support 1000 cell tables
  • Supports the latest Firefox & Chrome
Nail down
the minimum viable
set of supported
browser versions
with the customer
Idea
=
UX [how it is used]
+
Tech [how it works]
Always start from
defined goals -
never let idea to
rule your design
Works with
target browsers?
Interactions
work with target
browsers?
Performance is
good enough for
target data?
Proto DOD
• Includes main use-cases
• Works in target browsers
• Handles enough data
Never start design
or implementation
before prototyping
browser compatibility
and performance
Design UX and
API first.
Never continue
from
the prototype
implementation
Drawing detailed
wireframes & mockups
and testing them with
users will save
time later
Shamelessly copy UX.
Then your users
already
know how to use it.
Aim for multilayered
design that lets your
users (developers)
change behavior of
your component
DOM classes and
CSS restrictions
must be documented
to make styling easy
Keep component
project separate
from your real
application project
Demo application
must include all
features
and serve as example
for your users
Invest in project
setup with a rapid
save-to-see cycle and a
robust build script.
These might not be the
same thing.
https://vaadin.com/wiki/-/wiki/Main/
Component+Add-on+Project+Setup+HOWTO
There is no substitute
for manual testing and
user experience testing
Skip test driven
development, but invest
in regression testing
Pixel level regression
tests take time to set
up, but will be worth it
Never trust that
your changes would not
break other browsers
and skip cross-browser
testing
It is impossible to use
too much time in
polishing UX for a
reusable component.
35
                       Search…                               Explore Gist Blog Help                                                   jojule



  jojule / spreadsheet                                                                       Admin        Unwatch          Fork       Pull Request         1     1




           Code                       Network                 Pull Requests   0            Issues    0              Wiki     0                 Stats & Graphs


 Simple spreadsheet component for Vaadin — Read more
 https://vaadin.com/addon/spreadsheet


   Clone in Mac          ZIP         SSH    HTTP     Git Read-Only   git@github.com:jojule/spreadsheet.git                       Read+Write access



  branch: master             Files          Commits       Branches     1                                                                Tags          Downloads


 Latest commit to the master branch



            https://github.com/jojule/spreadsheet
 Update README.markdown

    jojule authored 4 hours ago                                                                                                                commit 7453f467b1



spreadsheet /
     name                                              age                        message                                                                  history

     design                                            a day ago                  Developing [Joonas Lehtinen]

     src                                               19 hours ago               Version 0.1 [Joonas Lehtinen]

     README.markdown                                   4 hours ago                Update README.markdown [jojule]

     licensing.txt                                     19 hours ago               Version 0.1 [Joonas Lehtinen]

     pom.xml                                           18 hours ago               Fixed add-on name [Joonas Lehtinen]




     README.markdown
README.markdown



Spreadsheet for Vaadin
The widget shows a spreadsheet - either from XLS file or by setting the cell contents programmatically.

This version is very limited and should be considered to be an early alpha -version. Try out the demo to see if it would be useful for you. I
mainly built it for an upcoming presentation.

SpreadsheetView class should be also usable in GWT without Vaadin Framework, but then you must implement SpreadsheetModel by
yourself.


Dependencies

     Apache POI 3.8 - http://poi.apache.org/

     Apache Commons Codec 1.5 - Required by POI - http://commons.apache.org/codec/


Release notes
Initial release with severe limitations:

     All columns and rows have fixed sizes

     No cell styling is supported

     No graphs are supported

     No merged cells are supported

     Performance for larger spreadsheets is really bad

     Only one spreadsheet widget is supported on screen at once


License & Author
T out my Spreadsheet!
 ry
 vaadin.com/addon/spreadsheet
https://github.com/jojule/
   spreadsheet/issues
Support HOWTO
               Ignore. wont-fix in best case.
               (the usual open source way)

Issue
reported by    Fix after 6 months,
actual user!   maybe...


               Fix immediately and thank
               the user who reported it
?
     Tue Vaadin &
20:00 C4 GWT BOF
    Wed Intro to
14:00 C4 Vaadin 7



           joonas@vaadin.com
             vaadin.com/joonas
               @joonaslehtinen

Contenu connexe

Similaire à Desingning reusable web components

html5 Canvas element
html5 Canvas elementhtml5 Canvas element
html5 Canvas element
Katja Hollaar
 
Easy charting with
Easy charting withEasy charting with
Easy charting with
Major Ye
 
Wordcamp Thessaloniki 2011 The Nextweb
Wordcamp Thessaloniki 2011 The NextwebWordcamp Thessaloniki 2011 The Nextweb
Wordcamp Thessaloniki 2011 The Nextweb
George Kanellopoulos
 

Similaire à Desingning reusable web components (20)

Html5 with Vaadin and Scala
Html5 with Vaadin and ScalaHtml5 with Vaadin and Scala
Html5 with Vaadin and Scala
 
Canvas Based Presentation - Zeroth Review
Canvas Based Presentation - Zeroth ReviewCanvas Based Presentation - Zeroth Review
Canvas Based Presentation - Zeroth Review
 
HTML5 - A Whirlwind tour
HTML5 - A Whirlwind tourHTML5 - A Whirlwind tour
HTML5 - A Whirlwind tour
 
Visualizing Data with JavaScript and Canvas
Visualizing Data with JavaScript and CanvasVisualizing Data with JavaScript and Canvas
Visualizing Data with JavaScript and Canvas
 
Media queries
Media queriesMedia queries
Media queries
 
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
 
Plunge into HTML5 Canvas – Let’s begin
Plunge into HTML5 Canvas – Let’s beginPlunge into HTML5 Canvas – Let’s begin
Plunge into HTML5 Canvas – Let’s begin
 
html5 Canvas element
html5 Canvas elementhtml5 Canvas element
html5 Canvas element
 
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
 
Vector Graphics on the Web: SVG, Canvas, CSS3
Vector Graphics on the Web: SVG, Canvas, CSS3Vector Graphics on the Web: SVG, Canvas, CSS3
Vector Graphics on the Web: SVG, Canvas, CSS3
 
The Modern Web, Part 2: HTML5
The Modern Web, Part 2: HTML5The Modern Web, Part 2: HTML5
The Modern Web, Part 2: HTML5
 
Easy charting with
Easy charting withEasy charting with
Easy charting with
 
Web Frontend development: tools and good practices to (re)organize the chaos
Web Frontend development: tools and good practices to (re)organize the chaosWeb Frontend development: tools and good practices to (re)organize the chaos
Web Frontend development: tools and good practices to (re)organize the chaos
 
The Canvas Tag
The Canvas TagThe Canvas Tag
The Canvas Tag
 
Wordcamp Thessaloniki 2011 The Nextweb
Wordcamp Thessaloniki 2011 The NextwebWordcamp Thessaloniki 2011 The Nextweb
Wordcamp Thessaloniki 2011 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
 
The Enterprise Dilemma: Native vs. Web
The Enterprise Dilemma: Native vs. WebThe Enterprise Dilemma: Native vs. Web
The Enterprise Dilemma: Native vs. Web
 
CANVAS vs SVG @ FrontInRio 2011
CANVAS vs SVG @ FrontInRio 2011CANVAS vs SVG @ FrontInRio 2011
CANVAS vs SVG @ FrontInRio 2011
 
Professional reports with SVG
Professional reports with SVGProfessional reports with SVG
Professional reports with SVG
 
From Flash to Canvas - a penchant for black holes
From Flash to Canvas - a penchant for black holesFrom Flash to Canvas - a penchant for black holes
From Flash to Canvas - a penchant for black holes
 

Plus de 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
 

Plus de 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
 
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
 
Vaadin 7 Today and Tomorrow
Vaadin 7 Today and TomorrowVaadin 7 Today and Tomorrow
Vaadin 7 Today and Tomorrow
 

Dernier

Dernier (20)

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

Desingning reusable web components

  • 1. Designing Reusable Web Components Dr. Joonas Lehtinen Vaadin @joonaslehtinen
  • 2. Agenda What do we Q&A want to design? Designing Web Component Technology Step-by-step •HTML5 / Canvas •Google Web Toolkit •Vaadin Framework
  • 6.
  • 8.
  • 10. 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
  • 12. Cross-document CSS3 messaging Document editing Multimedia Microdata WebGL Offline storage Canvas Markup improvements History management Forms Geolocation Drag-and-drop File API
  • 13. Canvas state state state
  • 15. 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
  • 17. Subset of IE6 java.lang, java.util Java to IE7 Widgetset JavaScript Compiler Firefox Your Application UI Safari
  • 18. simpler • 100% Java • Static typing • Object oriented • Excellent tooling
  • 19. less bugs • Stop debugging JavaScript spaghetti • Ignore most browser differences
  • 20. client-side • UI in client • Asyncronous RPC • Services (for UI)
  • 21.
  • 22.
  • 23. Vaadin is a UI framework for rich web applications
  • 24. java html
  • 25. Web application layers Backend Web Java to RPC JavaScript server server JavaScript Vaadin required required optional optional optional GWT required required required required optional JS required required required required
  • 26. 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
  • 27. How does it work, really?
  • 28. Initial HTML • CSS (theme) • Images • JavaScript 250k total
  • 29. • name=”Joonas” • button clicked 150 bytes
  • 30.
  • 31. • name=”Joonas” • button clicked 150 bytes • Add notification 466 bytes
  • 33.
  • 34.
  • 35. Download for Free vaadin.com/book Java fra me pplicatio work ns that d make you and 00 0 ~700 pages
  • 38.
  • 39.
  • 40. Need We can not get the UX we need with the existing widgets
  • 41. Goals • List of • real • quantifiable • requirements • for UX
  • 42. Example goals • Load and view data in XLS files • Show visual overview for numeric cols • Must support 1000 cell tables • Supports the latest Firefox & Chrome
  • 43. Nail down the minimum viable set of supported browser versions with the customer
  • 44. Idea = UX [how it is used] + Tech [how it works]
  • 45.
  • 46.
  • 47.
  • 48. Always start from defined goals - never let idea to rule your design
  • 49.
  • 51. Interactions work with target browsers? Performance is good enough for target data?
  • 52. Proto DOD • Includes main use-cases • Works in target browsers • Handles enough data
  • 53. Never start design or implementation before prototyping browser compatibility and performance
  • 54.
  • 55. Design UX and API first. Never continue from the prototype implementation
  • 56. Drawing detailed wireframes & mockups and testing them with users will save time later
  • 57.
  • 58. Shamelessly copy UX. Then your users already know how to use it.
  • 59.
  • 60. Aim for multilayered design that lets your users (developers) change behavior of your component
  • 61.
  • 62. DOM classes and CSS restrictions must be documented to make styling easy
  • 63.
  • 64. Keep component project separate from your real application project
  • 65. Demo application must include all features and serve as example for your users
  • 66.
  • 67. Invest in project setup with a rapid save-to-see cycle and a robust build script. These might not be the same thing.
  • 69.
  • 70. There is no substitute for manual testing and user experience testing
  • 71. Skip test driven development, but invest in regression testing
  • 72. Pixel level regression tests take time to set up, but will be worth it
  • 73. Never trust that your changes would not break other browsers and skip cross-browser testing
  • 74. It is impossible to use too much time in polishing UX for a reusable component.
  • 75.
  • 76. 35 Search… Explore Gist Blog Help jojule jojule / spreadsheet Admin Unwatch Fork Pull Request 1 1 Code Network Pull Requests 0 Issues 0 Wiki 0 Stats & Graphs Simple spreadsheet component for Vaadin — Read more https://vaadin.com/addon/spreadsheet  Clone in Mac ZIP SSH HTTP Git Read-Only git@github.com:jojule/spreadsheet.git Read+Write access branch: master Files Commits Branches 1 Tags Downloads Latest commit to the master branch https://github.com/jojule/spreadsheet Update README.markdown jojule authored 4 hours ago commit 7453f467b1 spreadsheet / name age message history design a day ago Developing [Joonas Lehtinen] src 19 hours ago Version 0.1 [Joonas Lehtinen] README.markdown 4 hours ago Update README.markdown [jojule] licensing.txt 19 hours ago Version 0.1 [Joonas Lehtinen] pom.xml 18 hours ago Fixed add-on name [Joonas Lehtinen] README.markdown
  • 77. README.markdown Spreadsheet for Vaadin The widget shows a spreadsheet - either from XLS file or by setting the cell contents programmatically. This version is very limited and should be considered to be an early alpha -version. Try out the demo to see if it would be useful for you. I mainly built it for an upcoming presentation. SpreadsheetView class should be also usable in GWT without Vaadin Framework, but then you must implement SpreadsheetModel by yourself. Dependencies Apache POI 3.8 - http://poi.apache.org/ Apache Commons Codec 1.5 - Required by POI - http://commons.apache.org/codec/ Release notes Initial release with severe limitations: All columns and rows have fixed sizes No cell styling is supported No graphs are supported No merged cells are supported Performance for larger spreadsheets is really bad Only one spreadsheet widget is supported on screen at once License & Author
  • 78.
  • 79.
  • 80.
  • 81.
  • 82.
  • 83.
  • 84.
  • 85.
  • 86.
  • 87. T out my Spreadsheet! ry vaadin.com/addon/spreadsheet
  • 88. https://github.com/jojule/ spreadsheet/issues
  • 89.
  • 90.
  • 91. Support HOWTO Ignore. wont-fix in best case. (the usual open source way) Issue reported by Fix after 6 months, actual user! maybe... Fix immediately and thank the user who reported it
  • 92. ? Tue Vaadin & 20:00 C4 GWT BOF Wed Intro to 14:00 C4 Vaadin 7 joonas@vaadin.com vaadin.com/joonas @joonaslehtinen