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



Similar documents
Jenkins User Conference Herzelia, July #jenkinsconf. Testing a Large Support Matrix Using Jenkins. Amir Kibbar HP

Rapid Application Development. and Application Generation Tools. Walter Knesel

Google Web Toolkit. Introduction to GWT Development. Ilkka Rinne & Sampo Savolainen / Spatineo Oy

Enterprise Application Development In Java with AJAX and ORM

Take full advantage of IBM s IDEs for end- to- end mobile development

Migration and Developer Productivity Solutions Retargeting IT for Emerging Business Needs

OXAGILE RESUMES SUMMARY OF QUALIFICATIONS TECHNICAL SKILLS SENIOR JAVA SOFTWARE ENGINEER

An introduction to creating Web 2.0 applications in Rational Application Developer Version 8.0

Portals, Portlets & Liferay Platform

How To Write An Ria Application

Internet Engineering: Web Application Architecture. Ali Kamandi Sharif University of Technology Fall 2007

CrownPeak Java Web Hosting. Version 0.20

Whitepaper. Rich Internet Applications. Frameworks Evaluation. Document reference: TSL-SES-WP0001 Januar

<Insert Picture Here> Oracle Policy Automation System Requirements

IBM Rational Web Developer for WebSphere Software Version 6.0

Framework Adoption for Java Enterprise Application Development

Glassfish, JAVA EE, Servlets, JSP, EJB

Progressive Enhancement With GQuery and GWT. Ray Cromwell

JAVA/J2EE DEVELOPER RESUME

Credits: Some of the slides are based on material adapted from

Java EE 6 development with Eclipse, Netbeans, IntelliJ and GlassFish. Ludovic Champenois Oracle Corporation

Rich Internet Applications

Web Development with the Eclipse Platform

WHITE PAPER. Domo Advanced Architecture

Lucy Zhang UI Developer Contact:

place/business fetch details, removefromfavorite () function, 189 search button handler bind, B BlackBerry build environment

<Insert Picture Here> GlassFish v3 - A Taste of a Next Generation Application Server

Design Approaches of Web Application with Efficient Performance in JAVA

IBM Digital Experience. Using Modern Web Development Tools and Technology with IBM Digital Experience

GlassFish v3. Building an ex tensible modular Java EE application server. Jerome Dochez and Ludovic Champenois Sun Microsystems, Inc.

AUTOMATED CONFERENCE CD-ROM BUILDER AN OPEN SOURCE APPROACH Stefan Karastanev

Data Visualization in Ext Js 3.4

PHP vs. Java. In this paper, I am not discussing following two issues since each is currently hotly debated in various communities:

Software Development Interactief Centrum voor gerichte Training en Studie Edisonweg 14c, 1821 BN Alkmaar T:

This document gives an outline of Tim Ward s work on mobile phone systems

Introducing Apache Pivot. Greg Brown, Todd Volkert 6/10/2010

Budget Event Management Design Document

<Insert Picture Here> Java, the language for the future

The Google Web Toolkit (GWT): Overview & Getting Started

Migration and Developer Productivity Solutions Cloud, Mobile and Web Development Workshop

Beyond the SOA/BPM frontiers Towards a complete open cooperative environment

Preface. Motivation for this Book

<Insert Picture Here> Oracle Application Express 4.0

Deepak Patil (Technical Director) iasys Technologies Pvt. Ltd.

opencrx Enterprise Class Open Source CRM

An introduction to creating JSF applications in Rational Application Developer Version 8.0

How To Write A Web Framework In Java

Google Web Toolkit (GWT) Architectural Impact on Enterprise Web Application

Java (J2SE & J2EE) and Web Development Training Catalog

2012 LABVANTAGE Solutions, Inc. All Rights Reserved.

Framework as a master tool in modern web development

<Insert Picture Here> Oracle Policy Automation System Requirements

What s New in IBM Web Experience Factory IBM Corporation

Oracle Application Development Framework Overview

GRAD Analytics Advanced price and promotional analysis interface. Reactive UI providing dimensional visibility to marketing analysis.

Apache Jakarta Tomcat

PG DAC. Syllabus. Content. Eligibility Criteria

Adam HAMEL. Bio. Core Competencies. Technical Background. adamhamel.com

Oracle WebLogic Foundation of Oracle Fusion Middleware. Lawrence Manickam Toyork Systems Inc

RedTigerSoftware. WEB DEVELOPERS Introduction & Portfolio

Web Cloud Architecture

Introduction to Oracle Mobile Application Framework Raghu Srinivasan, Director Development Mobile and Cloud Development Tools Oracle

Server-Side Scripting and Web Development. By Susan L. Miertschin

Architecture Guide Jahia EE v6.1

Drupal Performance Tuning

WebLogic & Coherence. Best backend for Mobile Apps. July 2014 INSERT PRESENTER TITLE AND DATE

ORACLE MOBILE APPLICATION FRAMEWORK DATA SHEET

Adding Panoramas to Google Maps Using Ajax

How To Write A Web Server In Javascript

Putting the power of Web 2.0 into practice.

EclipseLink. Solutions Guide for EclipseLink Release 2.5

FROM BANNER 8 TO BANNER XE. What s the story?

Is Liferay Right for Your Organization? Seven Things to Consider When Choosing a Portal Platform

Web Design Technology

How To Build A Web App

applications. JBoss Enterprise Application Platform

Front-End Performance Testing and Optimization

Dialogic PowerMedia Extended Media Server (XMS) RESTful Web Applications Using Google Web Toolkit and the Atmosphere Project.

Mobilize Your ERP with ADF Mobile

HtmlUnit: An Efficient Approach to Testing Web Applications

Introduction to Apache Roller. Matt Raible Apache Roller Committer June 2007

Learning HTML5 Game Programming

Quick start. A project with SpagoBI 3.x

SENIOR WEB DEVELOPER

2011 Marty Hall An Overview of Servlet & JSP Technology Customized Java EE Training:

IBM Script Portlet for WebSphere Portal Release 1.1

Nanda Kishor K N. nandakishorkn@gmail.com

Communiqué 4. Standardized Global Content Management. Designed for World s Leading Enterprises. Industry Leading Products & Platform

Introduction to IBM Worklight Mobile Platform

Java/J2EE or Web Developer. Formal Education. Technical knowledge. Spoken Languages

Web and Mobile development Engineer

This training is targeted at System Administrators and developers wanting to understand more about administering a WebLogic instance.

Performance Testing for Ajax Applications

Coding for Desktop and Mobile with HTML5 and Java EE 7

How to make a good Software Requirement Specification(SRS)

Transcription:

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

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

?

Vaadin is a UI framework for rich web applications

java html

History behind Vaadin

1998 healthcare portal, >100 kloc of perl,

web 1.0, netscape, ie5, ie6,...

thinking of object oriented design, desktop, Java, U and I...

desktop programming paradigm for web!

found millstone ajax google web toolkit 2000 2002 2005 2008

re-released as 2009

Used by >50.000 developers in >150 countries Building apps for fortune 500, startups, governments,... across all industries plug-ins, mainstream 2010 2011 Collaborating by conributing > 200 plug-ins and helping each other on a forum with >1500 posts / m Backed by 50+ person full-time team

see our transparent vaadin.com/roadmap 2012

Apache License

Contents Server-side RIA What is it? Pros & cons? Discussion Vaadin Technology, Features, Getting started In practice Coding a Vaadin application step-by-step

Server-side RIA

Web 1.0 Client 5 Server DOM HTML Page over HttpResponse View 4 Model 3 Parameters over HttpRequest 1 Controller 2 DB

client-side ria fat client

Client-side RIA Client View 5 4 Requested data to view as XML / JSON Server DOM 1 Model 3 Controller Changes to model encoded as parameters 2 DB

challenge web is not easy

Refactoring? Automated API docs? weak typing Compiletime checking? Code completion?

> 1 developers JavaScript facilitated spaghetti + weak typing + > 10k SLOC

performance browsers are bugs different features

Google Web Toolkit

Subset of java.lang, java.util Widgetset Java to JavaScript Compiler IE6 IE7 Firefox Your Application UI Safari

simpler 100% Java Static typing Object oriented Excellent tooling

less bugs Stop debugging JavaScript spaghetti Ignore most browser differences

client-side UI in client Asyncronous RPC Services (for UI)

Building wonderful apps doesn t require writing fat web clients.

server-side ria thin client

Server-side RIA Client DOM 9 TerminalAdapter HTML Page over HttpResponse Automated by the RIA framework Handled by the framework 1 8 Parameters over HttpRequest 2 TerminalAdapter 7 3 Server View Controller Model 4 6 5 DB

High level Strong programming model simpler 100% Java Strong typing Object oriented Excellent tooling less bugs No JavaScript debugging Ignore browsers

server enviroment Access any library Use any language Runtime is not limited by browser Trusted Well defined

simplified communications No RPC layer No services (for UI) Synchronous Direct access to server API

secure Code stays in server No services (for UI) Predictable runtime

not as scalable UI state is stored in the server memory

Measured 12.000 active concurrent users per server for a ticketing app * Amazon EC2-large; 20.622 Ajax requests / minute peak; limited by storage layer

no offline mode connection to server is always required

#1 benefit development is really fast

Seeing is believing National Geographic Channel 2010

What we can do in 20 minutes?

2 Java class files 50 LOC + imports no HTML no CSS no JavaScript no Cut-n-Paste

Vaadin Framework

Developer experience goals User expecience Scalability

123 ideas

1 amazing components

User Inteface Data Source Theme

User Inteface Data Source Theme

Reindeer Runo Chameleon Custom

User Inteface Data Source Theme

InMemory, Bean, Method, Collection, JDBC, JPA, Hibernate, TextFile, FileSystem, Properties, EclipseLink, Lucene, Mockups, GAE,... Your s

example SQLContainer

Table or any other UI component SQLContainer FreeformQuery JDBC SELECT * FROM...

connectionpool = new SimpleJDBCConnectionPool( "org.hsqldb.jdbc.jdbcdriver", "jdbc:hsqldb:mem:sqlcontainer", "password", "", 2, 2); SQLContainer container = new SQLContainer( new FreeformQuery( "SELECT * FROM people", Arrays.asList("ID"), connectionpool)); Table table = new Table(null, container);

Table or any other UI component SQLContainer TableQuery JDBC Database Table

lazy loading advanced filtering sorting connection pooling transactions optimistic locking autocommit mode

HSQLDB MySQL PostgreSQL Oracle MS SQL Server

2combine power of Server-side RIA Google Web Toolkit

Layers of abstraction backend frontend RPC browser browser server server any language any language json / xml java javascript Vaadin required required optional optional optional GWT required required required required optional ExtJS required required required X required

How does it work, really?

Initial HTML CSS (theme) Images JavaScript 830k total 250k 120k compress reduced widgetset

name= Joonas button clicked 150 bytes

name= Joonas button clicked 150 bytes Add notification 466 bytes

Vaadin UI component architecture UI Component Button, Table, Tree,... Server-side data Full Java API HTTP(S) Widget Client-side peer for the component Runs on JavaScript Java Compiled with JDK Java Google Web Toolkit

Creating new UI components is really easy

Implement two classes Server-side Client-side UI Component Define API Receive client events Send UI updates back Automatic Widget Render to DOM Collect user events

PaperStack notes = new PaperStack();!! @Override! public void init() { // === Layout ========================================================!! HorizontalLayout lo= new HorizontalLayout();!! Window mainwindow = new Window("Postitnotes Application", lo);!! lo.setsizefull();!! lo.addcomponent(notes);!! lo.setcomponentalignment(notes, Alignment.MIDDLE_CENTER);!! setmainwindow(mainwindow);!!!! notes.setwidth("350px");!! notes.setheight("350px");!! // === Note 1 ========================================================!! notes.addcomponent(new Label("<h1>TODO / Today</h1><div style='font-size: 24px'> + <p>enjoy the conference...</p></div>", Label.CONTENT_XHTML), "#fef49c"); // === Note 2 ========================================================!! notes.addcomponent(new Label("<h1>TODO / Tomorrow</h1><div style='font-size: 24px'> + <p>learn Vaadin!</p></div>", Label.CONTENT_XHTML), "#b2ffa1"); // === Note 3 ========================================================!! notes.addcomponent(new Label("<div style='font-size: 60px'><center><br/><br/><br/> + DOUBLE<br/><br/><br/>SPEED</center></div>", Label.CONTENT_XHTML), "#b2ffa1"); // === Note 4 ========================================================!! com.vaadin.ui.richtextarea rta = new RichTextArea();!! rta.setsizefull();!! notes.addcomponent(rta);!! rta.setvalue("<span style='font-size: 35pt; color: green;'>you can use any + Vaadin components here...</span>");! }

3embrace java

Any JVM Language

Scala with Scaladin add-on val layout = new VerticalLayout(width = 100 pct, height = 100 pct) { add(new Label(content = "Persons")) add(new Table(width = 100 pct, height = 100 pct), ratio = 1) add(new HorizontalLayout(spacing = true) { add(new Button("Edit selected", _ => editclicked())) add(new Button("Add new", _ => addnewclicked())) }) } getmainwindow.setcontent(layout)

Internet Explorer 6.. Chrome Firefox Safari Opera ios Android

No browser plugins Nothing to install

Servlet Portlet (most) clouds

Apache Tomcat, version 4.1 or later Oracle WebLogic Server, version 9.2 or later Oracle WebLogic Portal, version 10gR3 IBM WebSphere Application Server, version 6.1 or later IBM WebSphere Portal, version 6.1 and 7.0 JBoss Application Server, version 3.2.8 or later Jetty, version 5 or later Glassfish, version 2 or later Liferay Portal 5.2 or later GateIn Portal 3.1 exo Platform 3 Google App Engine Vaadin supports Java Servlet API 2.3 and JSR-168 and JSR-286 Portlet Specifications and should work with any Java application server that conforms to these standards.

Eclipse IntelliJ IDEA Netbeans Maven Ant Spring Roo

Maven mvn archetype:generate -DarchetypeGroupId=com.vaadin -DarchetypeArtifactId= vaadin-archetype-clean mvn package yourproject-1.0.war

PROD CTIV

persistence setup --provider HIBERNATE --database HYPERSONIC_IN_MEMORY entity --class ~.domain.topping field string --fieldname name --notnull entity --class ~.domain.pizza field number --fieldname price --type java.lang.float field set --fieldname toppings --type ~.domain.topping

vaadin setup --applicationpackage ~.web --basename PizzaShop --themename pizza --usejpacontainer false vaadin generate all --package ~.web.ui --visuallycomposable true

field string --class ~.domain.pizza --notnull --fieldname name --sizemin 3

getting started

vaadin.com/download

vaadin.com/comparison

Download for Free vaadin.com/book Vaadin is an open source Java framework for building modern web applications that look great, perform well and make you and your users happy. http://vaadin.com/ BN 978-952-92-6753-8 90000 789529 29.95 267538 4th Edition 674 pages

$43

#85 brought to you by....dzone.com Get More Refcardz! Visit refcardz.com CONTENTS INCLUDE: About Vaadin Creating An Application Components Layout Components Themes Data Binding and more... ABOUT VAADIN Vaadin is a server-side Ajax web application development framework that allows you to build web applications just like with traditional desktop frameworks, such as AWT or Swing. An application is built from user interface components contained hierarchically in layout components. In the server-driven model, the application code runs on a server, while the actual user interaction is handled by a client-side engine running in the browser. The client-server communications and any client-side technologies, such as HTML and JavaScript, are invisible to the developer. As the client-side engine runs as JavaScript in the browser, there is no need to install plug-ins. Vaadin is released under the Apache License 2.0. Web Browser Client-Side Engine Java Web Server Vaadin UI Components Figure 1: Vaadin Client-Server Architecture If the built-in selection of components is not enough, you can Getting Started with Vaadin Your Java Application Web Service EJB DB Web Browser Client-Side Engine Java Servlet Application Class User Application Figure 2: Architecture for Vaadin Applications Hot Tip AJAX Requests UI Component Inherits Events Changes Event Listener Servlet Container Data Model Data Binding Database By Marko Grönroos Default Theme Inherits Application Themes Application Resources External Resources File Resources You can get a reference to the application object from any component attached to the application with Event Listeners In the event-driven model, user interaction with user interface components triggers server-side events, which you can handle

Questions Comments s a n o o j / m o c vaadin. n e n i t h e l s a n o o j @ #vaadin