Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen
-
Upload
jaxconf -
Category
Technology
-
view
1.440 -
download
3
description
Transcript of Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen
![Page 1: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/1.jpg)
Joonas Lehtinen, PhDVaadin Ltd - CEO
vaadin.com/vaadin
Rich Web Applications in Server-side Java without
Plug-ins or JavaScript
@joonaslehtinen
![Page 2: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/2.jpg)
![Page 3: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/3.jpg)
Vaadin is a UI framework
for rich web applications
![Page 4: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/4.jpg)
htmljava
![Page 5: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/5.jpg)
History behind Vaadin
![Page 6: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/6.jpg)
healthcare portal, >100 kloc of perl, .. web 1.0, netscape, ie5, ie6, ...
1998
![Page 7: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/7.jpg)
healthcare portal, 100 kloc of perl, .. web 1.0, netscape, ie5, ie6, ...
![Page 8: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/8.jpg)
object oriented design, desktop, Java, U and I ...thinking of
![Page 9: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/9.jpg)
desktop programming paradigm for web! found
![Page 10: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/10.jpg)
desktop programming paradigm for web! found millstone ajax google web toolkit re-released as
2000
2002
2005
2008
![Page 11: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/11.jpg)
millstone ajax goolge web toolkit re-released as
2009
![Page 12: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/12.jpg)
plug-ins, mainstream
2010
2011
Used by >50.000 developers in >150 countries
Building apps for fortune 500, startups, governments, ... across all industries
Collaborating by conributing > 200plug-ins and helping each other on a forum with >1500 posts / m
Backed by 50+ person full-time team
![Page 13: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/13.jpg)
see our transparent vaadin.com/roadmap
2012
![Page 14: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/14.jpg)
ApacheLicense
![Page 15: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/15.jpg)
Discussion
VaadinTechnology, Features, Getting started
Server-side RIAWhat is it? Pros & cons?
In practiceCoding a Vaadin application step-by-step
Contents
![Page 16: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/16.jpg)
Server-side RIA
![Page 17: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/17.jpg)
“Web 1.0”
DOM
Client Server
ViewHTML Page
over HttpResponse
Controller
Model
Parameters overHttpRequest
DB2
3
4
5
1
![Page 18: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/18.jpg)
client-side ria
fat client
![Page 19: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/19.jpg)
Client-side RIA
DOM
Client Server
View
Controller
Model
DB2
3
4
5
1
Requested datato view as
XML / JSON
Changes to modelencoded as parameters
![Page 20: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/20.jpg)
challengeweb is
not easy
![Page 21: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/21.jpg)
weak typing
Codecompletion?
Refactoring?
Compile-time
checking?
AutomatedAPI docs?
![Page 22: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/22.jpg)
JavaScriptfacilitated spaghetti
weak typing
> 10k SLOC
> 1 developers+
+
![Page 23: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/23.jpg)
features
performancebrowsers
aredifferent
bugs
![Page 24: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/24.jpg)
Google Web Toolkit
![Page 25: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/25.jpg)
Java toJavaScriptCompiler
Subset of
java.lang, java.util
Widgetset
Your Application UI
IE6
IE7
Firefox
Safari
![Page 26: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/26.jpg)
simpler• 100% Java• Static typing• Object oriented• Excellent tooling
![Page 27: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/27.jpg)
less bugs • Stop debugging
JavaScript spaghetti • Ignore most
browser differences
![Page 28: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/28.jpg)
client-side• UI in client• Asyncronous RPC• Services (for UI)
![Page 29: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/29.jpg)
Building wonderful apps doesn’t require writing fat web clients.
![Page 30: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/30.jpg)
server-side ria
thin client
![Page 31: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/31.jpg)
Server-side RIA
DOM
Client Server
ViewHTML Pageover HttpResponse
Controller
Model
Parameters overHttpRequest
DB4
5
6
2
Term
inalAdapter
Term
inalAdapter
Automated bythe RIA framework
3
7
1
9
8
Handled by the framework
![Page 32: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/32.jpg)
Strong programming model
simpler• 100% Java• Strong typing• Object oriented• Excellent tooling
High level
less bugs• No JavaScript debugging• Ignore browsers
![Page 33: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/33.jpg)
server enviroment• Access any library• Use any language• Runtime is not
limited by browser• Trusted• Well defined
![Page 34: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/34.jpg)
simplifiedcommunications• No RPC layer• No services (for UI)• Synchronous• Direct access to
server API
![Page 35: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/35.jpg)
secure• Code stays in server• No services (for UI)• Predictable runtime
![Page 36: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/36.jpg)
not as scalableUI state is stored in the server memory
![Page 37: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/37.jpg)
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
![Page 38: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/38.jpg)
no offline modeconnection to server is always required
![Page 39: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/39.jpg)
#1 benefitdevelopmentis really fast
![Page 40: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/40.jpg)
![Page 41: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/41.jpg)
2 Java class files~ 50 LOC + importsno HTMLno CSSno JavaScriptno Cut-n-Paste
![Page 43: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/43.jpg)
Vaadin Framework
![Page 44: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/44.jpg)
Developerexperience
Userexpecience
Scalability
goals
![Page 45: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/45.jpg)
123ideas
![Page 46: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/46.jpg)
1amazingcomponents
![Page 47: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/47.jpg)
User IntefaceData Source
Theme
![Page 49: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/49.jpg)
![Page 50: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/50.jpg)
![Page 51: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/51.jpg)
User IntefaceData Source
Theme
![Page 52: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/52.jpg)
Reindeer
Runo
Chameleon
Custom
![Page 53: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/53.jpg)
User IntefaceData Source
Theme
![Page 54: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/54.jpg)
![Page 55: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/55.jpg)
InMemory, Bean, Method, Collection, JDBC, JPA, Hibernate, TextFile, FileSystem, Properties, EclipseLink, Lucene, Mockups, GAE, ... Your’s
![Page 56: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/56.jpg)
example
SQLContainer
![Page 57: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/57.jpg)
Tableor any other UI component
FreeformQuery
SQLContainer
JDBC
SELECT * FROM ...
![Page 58: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/58.jpg)
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);
![Page 59: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/59.jpg)
Tableor any other UI component
TableQuery
SQLContainer
JDBC
Database Table
![Page 60: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/60.jpg)
• lazy loading• advanced filtering• sorting• connection pooling• transactions• optimistic locking• autocommit mode
![Page 61: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/61.jpg)
• HSQLDB• MySQL• PostgreSQL • Oracle• MS SQL Server
![Page 62: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/62.jpg)
2combine power of• Server-side RIA• Google Web Toolkit
![Page 63: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/63.jpg)
javascriptjavajson / xmlany language any language
Layers of abstraction
browserbrowserfrontendserver
backendserver
required optional optionalrequired
RPC
optional
Vaa
din
required optionalrequired
GW
T
requiredrequired
Ext
JS
requiredrequired
required requiredX
➠
![Page 64: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/64.jpg)
How does it work, really?
![Page 65: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/65.jpg)
![Page 66: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/66.jpg)
• Initial HTML• CSS (theme)• Images• JavaScript
830k total
250k
compress
120k
reducedwidgetset
![Page 67: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/67.jpg)
• name=”Joonas”• button clicked
150 bytes
![Page 68: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/68.jpg)
![Page 69: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/69.jpg)
• name=”Joonas”• button clicked
150 bytes
• Add notification
466 bytes
![Page 70: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/70.jpg)
Vaadin UI component architecture
Java
• Google Web Toolkit
“UI Component”• Button, Table, Tree, ...• Server-side data• Full Java API
“Widget”• Client-side peer for
the component• Runs on JavaScript
HTTP(S)
Java
• Compiled with JDK
![Page 71: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/71.jpg)
Creating new UI components is really easy
![Page 72: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/72.jpg)
![Page 73: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/73.jpg)
Implement two classes
Automatic“UI Component”• Define API• Receive client events• Send UI updates
back
Server-side
“Widget”• Render to DOM• Collect user events
Client-side
![Page 74: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/74.jpg)
![Page 75: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/75.jpg)
![Page 76: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/76.jpg)
![Page 77: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/77.jpg)
![Page 78: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/78.jpg)
![Page 79: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/79.jpg)
Vaadin += GWT
![Page 80: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/80.jpg)
![Page 81: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/81.jpg)
GWTCompatible
![Page 82: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/82.jpg)
Server-
Client-si
deO
ptimized for
Productivity
Opt
imiz
ed fo
r
Cont
rol
![Page 83: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/83.jpg)
Server-
Client-side
Opt
imiz
ed fo
r
Prod
uctiv
ity
Optim
ized for
Control
![Page 84: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/84.jpg)
CommercialSupport
![Page 85: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/85.jpg)
3embracejava
![Page 86: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/86.jpg)
Any JVMLanguage
![Page 87: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/87.jpg)
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)
Scalawith Scaladin add-on
![Page 88: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/88.jpg)
Internet ExplorerChromeFirefoxSafariOpera
iOSAndroid
6..
![Page 89: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/89.jpg)
Nobrowserplugins
Nothing toinstall
![Page 90: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/90.jpg)
Servlet Portlet
(most) clouds
![Page 91: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/91.jpg)
Apache Tomcat, version 4.1 or laterOracle WebLogic Server, version 9.2 or laterOracle WebLogic Portal, version 10gR3IBM WebSphere Application Server, version 6.1 or laterIBM WebSphere Portal, version 6.1 and 7.0JBoss Application Server, version 3.2.8 or laterJetty, version 5 or laterGlassfish, version 2 or laterLiferay Portal 5.2 or laterGateIn Portal 3.1eXo Platform 3Google 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.
![Page 92: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/92.jpg)
EclipseIntelliJ IDEA
NetbeansMaven
AntSpring Roo
∙ ∙ ∙
![Page 93: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/93.jpg)
![Page 94: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/94.jpg)
mvn archetype:generate-DarchetypeGroupId=com.vaadin -DarchetypeArtifactId= vaadin-archetype-clean
Maven
yourproject-1.0.warmvn package
![Page 95: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/95.jpg)
gettingstarted
![Page 96: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/96.jpg)
![Page 97: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/97.jpg)
vaadin.com/download
![Page 98: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/98.jpg)
vaadin.com/comparison
![Page 99: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/99.jpg)
Download for Free
4th Edition
US $29.95
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/
2675387895299
ISBN 978-952-92-6753-890000
vaadin.com/book
674 pages
![Page 100: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/100.jpg)
�
By Marko Grönroos
ABOUT VAADIN
ww
w.d
zone
.co
m
G
et M
ore
Ref
card
z! V
isit
ref
card
z.co
m
#85
Getting Started with VaadinCONTENTS INCLUDE:�� About Vaadin�� Creating An Application�� Components �� Layout Components�� Themes�� Data Binding and more...
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.
Figure 1: Vaadin Client-Server Architecture
If the built-in selection of components is not enough, you can develop new components with the Google Web Toolkit (GWT)
Figure 2: Architecture for Vaadin Applications
Hot Tip
You can get a reference to the application object from any component attached to the application with ��$!!����$� ���
Event ListenersIn the event-driven model, user interaction with user interface components triggers server-side events, which you can handle
Web BrowserClient-Side Engine
JavaWeb Server
VaadinUIComponents
YourJavaApplication
WebService
EJB
DB
Servlet Container
UserApplication
EventListener
DataModel
ApplicationThemes
ApplicationResources
DefaultTheme
FileResources
ExternalResources
Database
DataBinding
Inherits Events Changes
AJAX Requests
Inherits
UIComponent
JavaServlet
ApplicationClass
Web BrowserClient-Side Engine
brought to you by...
![Page 101: Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joonas Lehtinen](https://reader034.fdocuments.in/reader034/viewer/2022042813/5484feaeb479590f0d8b4c9d/html5/thumbnails/101.jpg)
Expert servicesOnline support
TrainingTools
vaadin.com/pro
[email protected] vaadin.com/joonas
@joonaslehtinen#vaadin
Slides available onslideshare
Questions?Comments?
BetterResultsFaster