SlideShare a Scribd company logo
1 of 48
Download to read offline
Java Everywhere Again
With DukeScript http://www.dukescript.com
@DukeScript
Program Agenda
1st Cool Demo
Intro & Overview
2nd Cool Demo
Discussion
And so on...
1
2
3
4
5
2
Demo
3
Write Once and Display Anywhere!
GUI of Yesterday and Tomorrow
• Desktop applications (NetBeans Platform, Eclipse RCP)
– Not cool anymore
• Web applications (servlet, JSP, JSF, etc.)
– A bit too static
• Mobile applications
– Android is synonym for client side Java
• HTML5 applications
– HTML/CSS and JavaScript in the browser
– What should run on the server?
• Where is WORA?
4
The Battle Rages On
5
HTML5/CSS
• Most portable UI toolkit of today
– Any device with screen can render it
• 25-years of intensive use
– Robust, flexible
– A bit bloated
• Great tooling
– For UX designers
– Import/export assets
• Requires JavaScript!?
6
Designer vs. Developer
7
Infographic by: Shane Snow. Shane Snow is an entrepreneur, writer, and recent Columbia MS/Digital Media graduate. Visit his personal site and follow him on Twitter @shanesnow.
The JavaScript Problem
• Assembly language of today
– Like Z80, i8088 – cool programming “language” in 80-ties
• Runs everywhere
– Immediate availability in a browser
– Favorite target for other languages
• “WONTA”
– Write once and never touch again
• Tooling impossible
– Automatic refactorings in JavaScript!?
8
The Java Situation
• WORA - Java vision in 1995
– Client side & embedded technology vs. ended up on servers
• Eating up gigabytes of memory => worse than JavaScript?
• Java browser plugins (to be) banned
• Java tooling is great
– Twenty years of heavy industrial usage
– Reliable code-completion, refactorings
– Enormous amount of libraries
– A bit verbose
• One language to rule them all
– Same language on server and client. Can Java do it?
9
HTML5/CSS with Java (without JavaScript)
10
Duke's Choice
Award 2014 goes
to DukeScript
11
“DukeScript is the Lightweight
JavaFX I always dreamed of!”
– Stephen Chin, JavaOne M.C.
12
Demo
13
Anatomy of DukeScript Sample
Knockout.js
• Among four most popular JavaScript frameworks
• MVVC
– Don't touch your UI! Let it update itself!
●
Developers code. Designers play with CSS and HTML.
– Completely testable
●
Forget selenium! Unit testable!
• Revolutionary HTML/Java API
– More effective than plain JavaScript
●
Heavy use of annotation processors
– Initially may feel slightly upside down
14
Effective Java API
• Eliminate getters and setters
– Describe just properties
– Generate the class via annotation processors
– 100% Java compatible
• Java to “JSON” bindings
– Convert Java models to JSON
– Expose SPI to bind to knockout.js & others
• Effective client/server JSON communication
– REST & JSON – more effective than in JavaScript
15
Knockout 4 Java Bindings Architecture
16
Demo: Knockout 4 Java
17
Coding & Testing for KO4J
DukeScript's Highlights
• HTML/Java APIs
– Smooth integration of Java and HTML5
– NetBeans subproject
– Integrate any JavaScript library
• Java on any client
– Back to roots
– Excellent tooling
– Need runtime for iOS, Android, browsers
18
Android & Java
• Dalvik VM
– Java language, different bytecode
– Subset of Java libraries
– Synonym for Java on client
• Specific UI
– WebView component
●
Asynchronous JavaScript execution
– Bridge Java / browser calls
19
No Java on iOS!?
• “Apple bans Java on iOS”
– Not true. Bans dynamic code generation.
– Link everything statically!
• RoboVM
– Compiles to LLVM like Objective-C
– Uses Android non-GUI libs
●
Guarantees good compatibility
• Re-exposes Apple iOS APIs
– WebView
●
synchronous JavaScript execution
20
No Java in Browsers
• Firefox & Chrome ban Java
– Claiming plugins == security holes
– Push towards JavaScript or Dart or asm.js, etc.
• Bck2Brwsr VM
– AOT and JIT to JavaScript – no plugins needed!
– Optimized for V8
– Naturally displays HTML
– Subset of OpenJDK libraries
• Plus Tea VM, Doppio...
21
Demo: Tooling
22
Create, debug and deploy anywhere!
Integrate any library
• Call JavaScript from Java
– Annotate a method with @JavaScriptBody annotation
– Write its implementation in JavaScript
– Synchronous & asynchronous callbacks
• Call Java from JavaScript
– Identify method with a FQN and type signature
●
r.@java.lang.Runnable::run()()
●
@java.lang.String::valueOf(I)(10)
– Synchronous callbacks
• Builds on long time existing industry standard
23
Demo: Integrate a JS Library
24
Integration of 2D canvas
REST and WebSockets and JSON
• Pluggable SPI for parsing JSON
– Browser implementation or org.json library
• REST calls @OnReceive annotation
– Generates boilerplate code
●
Method to initialize the call and asynchronously get result
– Browser's XMLHttpResource
– URLConnection and JSON parser
– Integration with Jersey – same code on client and server
• Web Sockets via @OnReceive annotation
– Native browser or Glassfish's Tyrus implementation
25
Demo: REST
26
CRUD Demo Communication
Type-safe JSON API
• Everyone wants to create own JSON API
– org.json, javax.json, even JDK!
– Type safety => verbose and reflection
• Use @Model annotation for manual JSON parsing
– Type-safe
– Reflection-less
• Set proper environment
– Use knockout4j archetype, remove ko4j
– Add ko-tyrus-ws
●
Includes Java based JSON parser
27
Demo: Type-safe JSON Parsing
28
Parse JSON manually
Debugging JavaScript/Java apps
• Is anything wrong in your @JavaScriptBody?
– Write a unit test
– Debug it in NetBeans
– Simulate browser environment
• Avatar.js
– Node APIs on top of JVM
– Debug it in NetBeans
29
Demo: Debugging Mixed Apps
30
Java and JavaScript on the Stack
Controls.js
Technology for building (web and mobile) applications.
Jiří Tulach
tulach@position.cz
http://controlsjs.com
Position s.r.o. (Ltd.) - Creator of Controls.js
• History
– Founded in 2000
– Applications and services focused on electronic maps
– SaaS web application provider since 2005
– Controls.js technology since 2008 (made public in 2014)
• Customers
– Vodafone, T-Mobile, Telefónica O2, ČEZ Group, ...
• Partners
– HERE (formerly known as NAVTEQ and NOKIA Location & Commerce)
32
Why Controls.js?
• Standard web application development
– Switching between HTML, CSS and JavaScript
– Code sharing?
– Dealing with cross-browser incompatibilities
33
Why Controls.js?
• Standard web application development
– Switching between HTML, CSS and JavaScript
– Code sharing?
– Dealing with cross-browser incompatibilities
• Controls.js application development
– JavaScript only (No HTML, CSS needed only when creating Skins)
– Component based (No DOM)
●
create new components based on existing ones
– Cross-browser
●
IE6+, FF 2+, Opera 9.26+, Chrome, Safari
34
But Controls.js can do more...
• Touch support
– Supports gestures, unifies touch and mouse events
• Multi-device development
– GUI adjustments and JavaScript loading based on detected device
type
– Optimized for Apache Cordova/PhoneGap
• Localization
– Resource strings, GUI adjustments
• Model-View-ViewModel (MVVM)
– Knockout.js bindings
– ViewModel's typed properties handles parsing, formatting and
validation
35
...a lot more
• Application state handling
• Server communication
- GET/POST Request/Data/JSON, Script, IFRAME, Auto
• Asynchronous script loader
• Support for CSS sprite images
• Functions for objects duplication and merging
• Functions for URL escaping and HTML encoding/decoding
• etc.
36
37
var AppForm = null;
function ngMain()
{
AppForm = new ngControls({
Edit1: {
Type: 'weEdit',
L: 20, T: 20, W: 200,
Data: {
Text: 'Hello, world!'
}
}
});
AppForm.Update();
}
Hello World
Usable controls
• More than 100 visual and non-visual controls
– Buttons, Edit Boxes, Labels, Panels, Lists, Windows, Menus, …
– 3 different Skins
• Easy creation of new controls
– Create new controls based on existing ones
– Define only new visual styles (new skins)
– In application ad-hoc controls
– Encapsulate 3rd
party components (CodeMirror, amCharts)
38
Usable controls (partial sample)
39
Usable controls (partial sample)
40
Usable controls (partial sample)
41
Chart controls are
using
3rd
party library
amCharts
http://www.amcharts.c
om
Controls.js Tools – Form Editor
• WYSIWIG editor
• Controls.js application
• Instant updates
code ↔ preview ↔ properties
• Beta version available
http://formeditor.controlsjs.com
42
Controls.js Tools – Skin Editor
• CSS sprite definition
• Controls.js application
43
Application for Slovak Telekom – Desktop
version
44
Mobile version – Mobile web / Apache Cordova
application
45
Shares more than 90% of code with desktop
version.
Controls.js 4 Java
• Controls4j Package
– Integration based on Knockout.js (MVVM)
– Goal is to minimize usage of JavaScript
– Glues GUI defined in .ng files with DukeScript @Model classes
• NetBeans Controls.js 4 Java plug-in
– Integrates Controls.js Form Editor into NetBeans (associated
with .ng files)
46
Demo: Controls.js 4 Java
47
Building Controls.js Java Application
48
Questions?
Controls.js 4 Java:
GUI for DukeScript
DukeScript:
Write Once, Display Anywhere!

More Related Content

What's hot

Microsoft power point automation-opensourcetestingtools_matrix-1
Microsoft power point   automation-opensourcetestingtools_matrix-1Microsoft power point   automation-opensourcetestingtools_matrix-1
Microsoft power point automation-opensourcetestingtools_matrix-1tactqa
 
Core java over view basics introduction by quontra solutions
Core java over view basics introduction by quontra solutionsCore java over view basics introduction by quontra solutions
Core java over view basics introduction by quontra solutionsQUONTRASOLUTIONS
 
Develop realtime web with Scala and Xitrum
Develop realtime web with Scala and XitrumDevelop realtime web with Scala and Xitrum
Develop realtime web with Scala and XitrumNgoc Dao
 
Web Development with Delphi and React - ITDevCon 2016
Web Development with Delphi and React - ITDevCon 2016Web Development with Delphi and React - ITDevCon 2016
Web Development with Delphi and React - ITDevCon 2016Marco Breveglieri
 
Alexander Shitikov: Cross Platform Mobile Development. Business Logic for mob...
Alexander Shitikov: Cross Platform Mobile Development. Business Logic for mob...Alexander Shitikov: Cross Platform Mobile Development. Business Logic for mob...
Alexander Shitikov: Cross Platform Mobile Development. Business Logic for mob...Mobile Trends
 
EclipseCon Europe 2011
EclipseCon Europe 2011EclipseCon Europe 2011
EclipseCon Europe 2011Sigasi
 
Cordova + Ionic + MobileFirst
Cordova + Ionic + MobileFirstCordova + Ionic + MobileFirst
Cordova + Ionic + MobileFirstRaymond Camden
 
What's New in NetBeans IDE 7.x
What's New in NetBeans IDE 7.xWhat's New in NetBeans IDE 7.x
What's New in NetBeans IDE 7.xGeertjan Wielenga
 
Social Connections 2015 CrossWorlds and Domino
Social Connections 2015 CrossWorlds and DominoSocial Connections 2015 CrossWorlds and Domino
Social Connections 2015 CrossWorlds and DominoPaul Withers
 
From User Action to Framework Reaction
From User Action to Framework ReactionFrom User Action to Framework Reaction
From User Action to Framework Reactionjbandi
 
Bccon use notes objects in memory and other useful
Bccon   use notes objects in memory and other usefulBccon   use notes objects in memory and other useful
Bccon use notes objects in memory and other usefulFrank van der Linden
 
OSGi Community Event 2010 - OSGi and Android
OSGi Community Event 2010 - OSGi and AndroidOSGi Community Event 2010 - OSGi and Android
OSGi Community Event 2010 - OSGi and Androidmfrancis
 
Typescript in 30mins
Typescript in 30mins Typescript in 30mins
Typescript in 30mins Udaya Kumar
 
CodeFlow, an advanced IDE for Lua
CodeFlow, an advanced IDE for LuaCodeFlow, an advanced IDE for Lua
CodeFlow, an advanced IDE for Luajljumpertz
 
Presentation - Course about JavaFX
Presentation - Course about JavaFXPresentation - Course about JavaFX
Presentation - Course about JavaFXTom Mix Petreca
 

What's hot (18)

Microsoft power point automation-opensourcetestingtools_matrix-1
Microsoft power point   automation-opensourcetestingtools_matrix-1Microsoft power point   automation-opensourcetestingtools_matrix-1
Microsoft power point automation-opensourcetestingtools_matrix-1
 
Core java over view basics introduction by quontra solutions
Core java over view basics introduction by quontra solutionsCore java over view basics introduction by quontra solutions
Core java over view basics introduction by quontra solutions
 
Develop realtime web with Scala and Xitrum
Develop realtime web with Scala and XitrumDevelop realtime web with Scala and Xitrum
Develop realtime web with Scala and Xitrum
 
Web Development with Delphi and React - ITDevCon 2016
Web Development with Delphi and React - ITDevCon 2016Web Development with Delphi and React - ITDevCon 2016
Web Development with Delphi and React - ITDevCon 2016
 
Alexander Shitikov: Cross Platform Mobile Development. Business Logic for mob...
Alexander Shitikov: Cross Platform Mobile Development. Business Logic for mob...Alexander Shitikov: Cross Platform Mobile Development. Business Logic for mob...
Alexander Shitikov: Cross Platform Mobile Development. Business Logic for mob...
 
EclipseCon Europe 2011
EclipseCon Europe 2011EclipseCon Europe 2011
EclipseCon Europe 2011
 
Cordova + Ionic + MobileFirst
Cordova + Ionic + MobileFirstCordova + Ionic + MobileFirst
Cordova + Ionic + MobileFirst
 
What's New in NetBeans IDE 7.x
What's New in NetBeans IDE 7.xWhat's New in NetBeans IDE 7.x
What's New in NetBeans IDE 7.x
 
Social Connections 2015 CrossWorlds and Domino
Social Connections 2015 CrossWorlds and DominoSocial Connections 2015 CrossWorlds and Domino
Social Connections 2015 CrossWorlds and Domino
 
JavaFX in Action Part I
JavaFX in Action Part IJavaFX in Action Part I
JavaFX in Action Part I
 
From User Action to Framework Reaction
From User Action to Framework ReactionFrom User Action to Framework Reaction
From User Action to Framework Reaction
 
Bccon use notes objects in memory and other useful
Bccon   use notes objects in memory and other usefulBccon   use notes objects in memory and other useful
Bccon use notes objects in memory and other useful
 
OSGi Community Event 2010 - OSGi and Android
OSGi Community Event 2010 - OSGi and AndroidOSGi Community Event 2010 - OSGi and Android
OSGi Community Event 2010 - OSGi and Android
 
Typescript in 30mins
Typescript in 30mins Typescript in 30mins
Typescript in 30mins
 
TypeScript Overview
TypeScript OverviewTypeScript Overview
TypeScript Overview
 
CodeFlow, an advanced IDE for Lua
CodeFlow, an advanced IDE for LuaCodeFlow, an advanced IDE for Lua
CodeFlow, an advanced IDE for Lua
 
Apache Cordova
Apache CordovaApache Cordova
Apache Cordova
 
Presentation - Course about JavaFX
Presentation - Course about JavaFXPresentation - Course about JavaFX
Presentation - Course about JavaFX
 

Viewers also liked

JDD2015: What is code? - Jakub Marchwicki
JDD2015: What is code? - Jakub MarchwickiJDD2015: What is code? - Jakub Marchwicki
JDD2015: What is code? - Jakub MarchwickiPROIDEA
 
JDD2015: Sustainability Supporting Data Variability: Keeping Core Components ...
JDD2015: Sustainability Supporting Data Variability: Keeping Core Components ...JDD2015: Sustainability Supporting Data Variability: Keeping Core Components ...
JDD2015: Sustainability Supporting Data Variability: Keeping Core Components ...PROIDEA
 
PLNOG14: Automation at Brainly - Paweł Rozlach
PLNOG14: Automation at Brainly - Paweł RozlachPLNOG14: Automation at Brainly - Paweł Rozlach
PLNOG14: Automation at Brainly - Paweł RozlachPROIDEA
 
4Developers 2015: Dobrze posól swoje hasło: skróty haseł w webie - Leszek Kru...
4Developers 2015: Dobrze posól swoje hasło: skróty haseł w webie - Leszek Kru...4Developers 2015: Dobrze posól swoje hasło: skróty haseł w webie - Leszek Kru...
4Developers 2015: Dobrze posól swoje hasło: skróty haseł w webie - Leszek Kru...PROIDEA
 
4Developers 2015: Skalowanie i integracja systemów w asynchronicznym stylu - ...
4Developers 2015: Skalowanie i integracja systemów w asynchronicznym stylu - ...4Developers 2015: Skalowanie i integracja systemów w asynchronicznym stylu - ...
4Developers 2015: Skalowanie i integracja systemów w asynchronicznym stylu - ...PROIDEA
 
4Developers 2015: Jak (w końcu) zacząć pracować z DDD wykorzystując BDD - Kac...
4Developers 2015: Jak (w końcu) zacząć pracować z DDD wykorzystując BDD - Kac...4Developers 2015: Jak (w końcu) zacząć pracować z DDD wykorzystując BDD - Kac...
4Developers 2015: Jak (w końcu) zacząć pracować z DDD wykorzystując BDD - Kac...PROIDEA
 
4Developers 2015: Programowanie synchroniczne i asynchroniczne - dwa światy k...
4Developers 2015: Programowanie synchroniczne i asynchroniczne - dwa światy k...4Developers 2015: Programowanie synchroniczne i asynchroniczne - dwa światy k...
4Developers 2015: Programowanie synchroniczne i asynchroniczne - dwa światy k...PROIDEA
 
4Developers 2015: Customer Journey Based UX Design - Łukasz Szadkowski
4Developers 2015: Customer Journey Based UX Design - Łukasz Szadkowski4Developers 2015: Customer Journey Based UX Design - Łukasz Szadkowski
4Developers 2015: Customer Journey Based UX Design - Łukasz SzadkowskiPROIDEA
 
JDD2015: Ratpack: core of your micro-services - Andrey Adamovich
JDD2015: Ratpack: core of your micro-services - Andrey AdamovichJDD2015: Ratpack: core of your micro-services - Andrey Adamovich
JDD2015: Ratpack: core of your micro-services - Andrey AdamovichPROIDEA
 
Sprytniejsze testowanie kodu java ze spock framework (zaawansowane techniki) ...
Sprytniejsze testowanie kodu java ze spock framework (zaawansowane techniki) ...Sprytniejsze testowanie kodu java ze spock framework (zaawansowane techniki) ...
Sprytniejsze testowanie kodu java ze spock framework (zaawansowane techniki) ...PROIDEA
 
JDD2015: Make your world event driven - Krzysztof Dębski
JDD2015: Make your world event driven - Krzysztof DębskiJDD2015: Make your world event driven - Krzysztof Dębski
JDD2015: Make your world event driven - Krzysztof DębskiPROIDEA
 
4Developers 2015: .NET 2015 - co nowego? - Michał Dudak, Future Processing
4Developers 2015: .NET 2015 - co nowego? - Michał Dudak, Future Processing4Developers 2015: .NET 2015 - co nowego? - Michał Dudak, Future Processing
4Developers 2015: .NET 2015 - co nowego? - Michał Dudak, Future ProcessingPROIDEA
 
JDD2015: Twenty-one years of "Design Patterns" - Ralph Johnson
JDD2015: Twenty-one years of "Design Patterns" - Ralph JohnsonJDD2015: Twenty-one years of "Design Patterns" - Ralph Johnson
JDD2015: Twenty-one years of "Design Patterns" - Ralph JohnsonPROIDEA
 
JDD2015: Piękny Pan od HR radzi, czyli 1011 błędów, które popełniają programi...
JDD2015: Piękny Pan od HR radzi, czyli 1011 błędów, które popełniają programi...JDD2015: Piękny Pan od HR radzi, czyli 1011 błędów, które popełniają programi...
JDD2015: Piękny Pan od HR radzi, czyli 1011 błędów, które popełniają programi...PROIDEA
 
DevOpsDays Warsaw 2015: JaaC - Jenkins as a Code – Łukasz Szczęsny
DevOpsDays Warsaw 2015: JaaC - Jenkins as a Code – Łukasz SzczęsnyDevOpsDays Warsaw 2015: JaaC - Jenkins as a Code – Łukasz Szczęsny
DevOpsDays Warsaw 2015: JaaC - Jenkins as a Code – Łukasz SzczęsnyPROIDEA
 
PLNOG15: BGP Route Reflector from practical point of view
PLNOG15: BGP Route Reflector from practical point of viewPLNOG15: BGP Route Reflector from practical point of view
PLNOG15: BGP Route Reflector from practical point of viewPROIDEA
 
DevOpsDays Warsaw 2015: From core Java to Devops team – Krzysztof Debski
DevOpsDays Warsaw 2015: From core Java to Devops team – Krzysztof DebskiDevOpsDays Warsaw 2015: From core Java to Devops team – Krzysztof Debski
DevOpsDays Warsaw 2015: From core Java to Devops team – Krzysztof DebskiPROIDEA
 
PLNOG15: Automation of deployment and management of network devices - Oskar J...
PLNOG15: Automation of deployment and management of network devices - Oskar J...PLNOG15: Automation of deployment and management of network devices - Oskar J...
PLNOG15: Automation of deployment and management of network devices - Oskar J...PROIDEA
 
PLNOG15: What about latency? - Piotr Jabłoński
PLNOG15: What about latency? - Piotr JabłońskiPLNOG15: What about latency? - Piotr Jabłoński
PLNOG15: What about latency? - Piotr JabłońskiPROIDEA
 

Viewers also liked (20)

JDD2015: What is code? - Jakub Marchwicki
JDD2015: What is code? - Jakub MarchwickiJDD2015: What is code? - Jakub Marchwicki
JDD2015: What is code? - Jakub Marchwicki
 
JDD2015: Sustainability Supporting Data Variability: Keeping Core Components ...
JDD2015: Sustainability Supporting Data Variability: Keeping Core Components ...JDD2015: Sustainability Supporting Data Variability: Keeping Core Components ...
JDD2015: Sustainability Supporting Data Variability: Keeping Core Components ...
 
PLNOG14: Automation at Brainly - Paweł Rozlach
PLNOG14: Automation at Brainly - Paweł RozlachPLNOG14: Automation at Brainly - Paweł Rozlach
PLNOG14: Automation at Brainly - Paweł Rozlach
 
4Developers 2015: Dobrze posól swoje hasło: skróty haseł w webie - Leszek Kru...
4Developers 2015: Dobrze posól swoje hasło: skróty haseł w webie - Leszek Kru...4Developers 2015: Dobrze posól swoje hasło: skróty haseł w webie - Leszek Kru...
4Developers 2015: Dobrze posól swoje hasło: skróty haseł w webie - Leszek Kru...
 
4Developers 2015: Skalowanie i integracja systemów w asynchronicznym stylu - ...
4Developers 2015: Skalowanie i integracja systemów w asynchronicznym stylu - ...4Developers 2015: Skalowanie i integracja systemów w asynchronicznym stylu - ...
4Developers 2015: Skalowanie i integracja systemów w asynchronicznym stylu - ...
 
4Developers 2015: Jak (w końcu) zacząć pracować z DDD wykorzystując BDD - Kac...
4Developers 2015: Jak (w końcu) zacząć pracować z DDD wykorzystując BDD - Kac...4Developers 2015: Jak (w końcu) zacząć pracować z DDD wykorzystując BDD - Kac...
4Developers 2015: Jak (w końcu) zacząć pracować z DDD wykorzystując BDD - Kac...
 
4Developers 2015: Programowanie synchroniczne i asynchroniczne - dwa światy k...
4Developers 2015: Programowanie synchroniczne i asynchroniczne - dwa światy k...4Developers 2015: Programowanie synchroniczne i asynchroniczne - dwa światy k...
4Developers 2015: Programowanie synchroniczne i asynchroniczne - dwa światy k...
 
4Developers 2015: Customer Journey Based UX Design - Łukasz Szadkowski
4Developers 2015: Customer Journey Based UX Design - Łukasz Szadkowski4Developers 2015: Customer Journey Based UX Design - Łukasz Szadkowski
4Developers 2015: Customer Journey Based UX Design - Łukasz Szadkowski
 
JDD2015: Ratpack: core of your micro-services - Andrey Adamovich
JDD2015: Ratpack: core of your micro-services - Andrey AdamovichJDD2015: Ratpack: core of your micro-services - Andrey Adamovich
JDD2015: Ratpack: core of your micro-services - Andrey Adamovich
 
Sprytniejsze testowanie kodu java ze spock framework (zaawansowane techniki) ...
Sprytniejsze testowanie kodu java ze spock framework (zaawansowane techniki) ...Sprytniejsze testowanie kodu java ze spock framework (zaawansowane techniki) ...
Sprytniejsze testowanie kodu java ze spock framework (zaawansowane techniki) ...
 
JDD2015: Make your world event driven - Krzysztof Dębski
JDD2015: Make your world event driven - Krzysztof DębskiJDD2015: Make your world event driven - Krzysztof Dębski
JDD2015: Make your world event driven - Krzysztof Dębski
 
4Developers 2015: .NET 2015 - co nowego? - Michał Dudak, Future Processing
4Developers 2015: .NET 2015 - co nowego? - Michał Dudak, Future Processing4Developers 2015: .NET 2015 - co nowego? - Michał Dudak, Future Processing
4Developers 2015: .NET 2015 - co nowego? - Michał Dudak, Future Processing
 
JDD2015: Twenty-one years of "Design Patterns" - Ralph Johnson
JDD2015: Twenty-one years of "Design Patterns" - Ralph JohnsonJDD2015: Twenty-one years of "Design Patterns" - Ralph Johnson
JDD2015: Twenty-one years of "Design Patterns" - Ralph Johnson
 
JDD2015: Piękny Pan od HR radzi, czyli 1011 błędów, które popełniają programi...
JDD2015: Piękny Pan od HR radzi, czyli 1011 błędów, które popełniają programi...JDD2015: Piękny Pan od HR radzi, czyli 1011 błędów, które popełniają programi...
JDD2015: Piękny Pan od HR radzi, czyli 1011 błędów, które popełniają programi...
 
DevOpsDays Warsaw 2015: JaaC - Jenkins as a Code – Łukasz Szczęsny
DevOpsDays Warsaw 2015: JaaC - Jenkins as a Code – Łukasz SzczęsnyDevOpsDays Warsaw 2015: JaaC - Jenkins as a Code – Łukasz Szczęsny
DevOpsDays Warsaw 2015: JaaC - Jenkins as a Code – Łukasz Szczęsny
 
PLNOG15: BGP Route Reflector from practical point of view
PLNOG15: BGP Route Reflector from practical point of viewPLNOG15: BGP Route Reflector from practical point of view
PLNOG15: BGP Route Reflector from practical point of view
 
DevOpsDays Warsaw 2015: From core Java to Devops team – Krzysztof Debski
DevOpsDays Warsaw 2015: From core Java to Devops team – Krzysztof DebskiDevOpsDays Warsaw 2015: From core Java to Devops team – Krzysztof Debski
DevOpsDays Warsaw 2015: From core Java to Devops team – Krzysztof Debski
 
Work commute Top 10 Mobile apps
Work commute Top 10 Mobile appsWork commute Top 10 Mobile apps
Work commute Top 10 Mobile apps
 
PLNOG15: Automation of deployment and management of network devices - Oskar J...
PLNOG15: Automation of deployment and management of network devices - Oskar J...PLNOG15: Automation of deployment and management of network devices - Oskar J...
PLNOG15: Automation of deployment and management of network devices - Oskar J...
 
PLNOG15: What about latency? - Piotr Jabłoński
PLNOG15: What about latency? - Piotr JabłońskiPLNOG15: What about latency? - Piotr Jabłoński
PLNOG15: What about latency? - Piotr Jabłoński
 

Similar to JDD2015: Java Everywhere Again—with DukeScript - Jaroslav Tulach

An introduction to Node.js
An introduction to Node.jsAn introduction to Node.js
An introduction to Node.jsKasey McCurdy
 
Meetup. Technologies Intro for Non-Tech People
Meetup. Technologies Intro for Non-Tech PeopleMeetup. Technologies Intro for Non-Tech People
Meetup. Technologies Intro for Non-Tech PeopleIT Arena
 
What is Mean Stack Development ?
What is Mean Stack Development ?What is Mean Stack Development ?
What is Mean Stack Development ?Balajihope
 
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...Malin Weiss
 
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...Speedment, Inc.
 
Tech io spa_angularjs_20130814_v0.9.5
Tech io spa_angularjs_20130814_v0.9.5Tech io spa_angularjs_20130814_v0.9.5
Tech io spa_angularjs_20130814_v0.9.5Ganesh Kondal
 
Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2
Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2
Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2Jeremy Likness
 
An evening with React Native
An evening with React NativeAn evening with React Native
An evening with React NativeMike Melusky
 
Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC  Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC vipin kumar
 
Node.js meetup at Palo Alto Networks Tel Aviv
Node.js meetup at Palo Alto Networks Tel AvivNode.js meetup at Palo Alto Networks Tel Aviv
Node.js meetup at Palo Alto Networks Tel AvivRon Perlmuter
 
Meanstack Introduction by Kishore Chandra
Meanstack Introduction by Kishore ChandraMeanstack Introduction by Kishore Chandra
Meanstack Introduction by Kishore ChandraKishore Chandra
 
Introduction to web application development with Vue (for absolute beginners)...
Introduction to web application development with Vue (for absolute beginners)...Introduction to web application development with Vue (for absolute beginners)...
Introduction to web application development with Vue (for absolute beginners)...Lucas Jellema
 
Intro to node.js - Ran Mizrahi (27/8/2014)
Intro to node.js - Ran Mizrahi (27/8/2014)Intro to node.js - Ran Mizrahi (27/8/2014)
Intro to node.js - Ran Mizrahi (27/8/2014)Ran Mizrahi
 
Intro to node.js - Ran Mizrahi (28/8/14)
Intro to node.js - Ran Mizrahi (28/8/14)Intro to node.js - Ran Mizrahi (28/8/14)
Intro to node.js - Ran Mizrahi (28/8/14)Ran Mizrahi
 

Similar to JDD2015: Java Everywhere Again—with DukeScript - Jaroslav Tulach (20)

An introduction to Node.js
An introduction to Node.jsAn introduction to Node.js
An introduction to Node.js
 
Meetup. Technologies Intro for Non-Tech People
Meetup. Technologies Intro for Non-Tech PeopleMeetup. Technologies Intro for Non-Tech People
Meetup. Technologies Intro for Non-Tech People
 
What is Mean Stack Development ?
What is Mean Stack Development ?What is Mean Stack Development ?
What is Mean Stack Development ?
 
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
 
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
 
Mean stack
Mean stackMean stack
Mean stack
 
Tech io spa_angularjs_20130814_v0.9.5
Tech io spa_angularjs_20130814_v0.9.5Tech io spa_angularjs_20130814_v0.9.5
Tech io spa_angularjs_20130814_v0.9.5
 
Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2
Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2
Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2
 
An evening with React Native
An evening with React NativeAn evening with React Native
An evening with React Native
 
MEAN Stack
MEAN StackMEAN Stack
MEAN Stack
 
MEAN Stack
MEAN StackMEAN Stack
MEAN Stack
 
Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC  Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC
 
Node.js meetup at Palo Alto Networks Tel Aviv
Node.js meetup at Palo Alto Networks Tel AvivNode.js meetup at Palo Alto Networks Tel Aviv
Node.js meetup at Palo Alto Networks Tel Aviv
 
Meanstack Introduction by Kishore Chandra
Meanstack Introduction by Kishore ChandraMeanstack Introduction by Kishore Chandra
Meanstack Introduction by Kishore Chandra
 
01 java intro
01 java intro01 java intro
01 java intro
 
Introduction to web application development with Vue (for absolute beginners)...
Introduction to web application development with Vue (for absolute beginners)...Introduction to web application development with Vue (for absolute beginners)...
Introduction to web application development with Vue (for absolute beginners)...
 
Intro to node.js - Ran Mizrahi (27/8/2014)
Intro to node.js - Ran Mizrahi (27/8/2014)Intro to node.js - Ran Mizrahi (27/8/2014)
Intro to node.js - Ran Mizrahi (27/8/2014)
 
Intro to node.js - Ran Mizrahi (28/8/14)
Intro to node.js - Ran Mizrahi (28/8/14)Intro to node.js - Ran Mizrahi (28/8/14)
Intro to node.js - Ran Mizrahi (28/8/14)
 
ASP.NET
ASP.NETASP.NET
ASP.NET
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 

Recently uploaded

Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 

Recently uploaded (20)

Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 

JDD2015: Java Everywhere Again—with DukeScript - Jaroslav Tulach

  • 1. Java Everywhere Again With DukeScript http://www.dukescript.com @DukeScript
  • 2. Program Agenda 1st Cool Demo Intro & Overview 2nd Cool Demo Discussion And so on... 1 2 3 4 5 2
  • 3. Demo 3 Write Once and Display Anywhere!
  • 4. GUI of Yesterday and Tomorrow • Desktop applications (NetBeans Platform, Eclipse RCP) – Not cool anymore • Web applications (servlet, JSP, JSF, etc.) – A bit too static • Mobile applications – Android is synonym for client side Java • HTML5 applications – HTML/CSS and JavaScript in the browser – What should run on the server? • Where is WORA? 4
  • 6. HTML5/CSS • Most portable UI toolkit of today – Any device with screen can render it • 25-years of intensive use – Robust, flexible – A bit bloated • Great tooling – For UX designers – Import/export assets • Requires JavaScript!? 6
  • 7. Designer vs. Developer 7 Infographic by: Shane Snow. Shane Snow is an entrepreneur, writer, and recent Columbia MS/Digital Media graduate. Visit his personal site and follow him on Twitter @shanesnow.
  • 8. The JavaScript Problem • Assembly language of today – Like Z80, i8088 – cool programming “language” in 80-ties • Runs everywhere – Immediate availability in a browser – Favorite target for other languages • “WONTA” – Write once and never touch again • Tooling impossible – Automatic refactorings in JavaScript!? 8
  • 9. The Java Situation • WORA - Java vision in 1995 – Client side & embedded technology vs. ended up on servers • Eating up gigabytes of memory => worse than JavaScript? • Java browser plugins (to be) banned • Java tooling is great – Twenty years of heavy industrial usage – Reliable code-completion, refactorings – Enormous amount of libraries – A bit verbose • One language to rule them all – Same language on server and client. Can Java do it? 9
  • 10. HTML5/CSS with Java (without JavaScript) 10
  • 11. Duke's Choice Award 2014 goes to DukeScript 11
  • 12. “DukeScript is the Lightweight JavaFX I always dreamed of!” – Stephen Chin, JavaOne M.C. 12
  • 14. Knockout.js • Among four most popular JavaScript frameworks • MVVC – Don't touch your UI! Let it update itself! ● Developers code. Designers play with CSS and HTML. – Completely testable ● Forget selenium! Unit testable! • Revolutionary HTML/Java API – More effective than plain JavaScript ● Heavy use of annotation processors – Initially may feel slightly upside down 14
  • 15. Effective Java API • Eliminate getters and setters – Describe just properties – Generate the class via annotation processors – 100% Java compatible • Java to “JSON” bindings – Convert Java models to JSON – Expose SPI to bind to knockout.js & others • Effective client/server JSON communication – REST & JSON – more effective than in JavaScript 15
  • 16. Knockout 4 Java Bindings Architecture 16
  • 17. Demo: Knockout 4 Java 17 Coding & Testing for KO4J
  • 18. DukeScript's Highlights • HTML/Java APIs – Smooth integration of Java and HTML5 – NetBeans subproject – Integrate any JavaScript library • Java on any client – Back to roots – Excellent tooling – Need runtime for iOS, Android, browsers 18
  • 19. Android & Java • Dalvik VM – Java language, different bytecode – Subset of Java libraries – Synonym for Java on client • Specific UI – WebView component ● Asynchronous JavaScript execution – Bridge Java / browser calls 19
  • 20. No Java on iOS!? • “Apple bans Java on iOS” – Not true. Bans dynamic code generation. – Link everything statically! • RoboVM – Compiles to LLVM like Objective-C – Uses Android non-GUI libs ● Guarantees good compatibility • Re-exposes Apple iOS APIs – WebView ● synchronous JavaScript execution 20
  • 21. No Java in Browsers • Firefox & Chrome ban Java – Claiming plugins == security holes – Push towards JavaScript or Dart or asm.js, etc. • Bck2Brwsr VM – AOT and JIT to JavaScript – no plugins needed! – Optimized for V8 – Naturally displays HTML – Subset of OpenJDK libraries • Plus Tea VM, Doppio... 21
  • 22. Demo: Tooling 22 Create, debug and deploy anywhere!
  • 23. Integrate any library • Call JavaScript from Java – Annotate a method with @JavaScriptBody annotation – Write its implementation in JavaScript – Synchronous & asynchronous callbacks • Call Java from JavaScript – Identify method with a FQN and type signature ● r.@java.lang.Runnable::run()() ● @java.lang.String::valueOf(I)(10) – Synchronous callbacks • Builds on long time existing industry standard 23
  • 24. Demo: Integrate a JS Library 24 Integration of 2D canvas
  • 25. REST and WebSockets and JSON • Pluggable SPI for parsing JSON – Browser implementation or org.json library • REST calls @OnReceive annotation – Generates boilerplate code ● Method to initialize the call and asynchronously get result – Browser's XMLHttpResource – URLConnection and JSON parser – Integration with Jersey – same code on client and server • Web Sockets via @OnReceive annotation – Native browser or Glassfish's Tyrus implementation 25
  • 26. Demo: REST 26 CRUD Demo Communication
  • 27. Type-safe JSON API • Everyone wants to create own JSON API – org.json, javax.json, even JDK! – Type safety => verbose and reflection • Use @Model annotation for manual JSON parsing – Type-safe – Reflection-less • Set proper environment – Use knockout4j archetype, remove ko4j – Add ko-tyrus-ws ● Includes Java based JSON parser 27
  • 28. Demo: Type-safe JSON Parsing 28 Parse JSON manually
  • 29. Debugging JavaScript/Java apps • Is anything wrong in your @JavaScriptBody? – Write a unit test – Debug it in NetBeans – Simulate browser environment • Avatar.js – Node APIs on top of JVM – Debug it in NetBeans 29
  • 30. Demo: Debugging Mixed Apps 30 Java and JavaScript on the Stack
  • 31. Controls.js Technology for building (web and mobile) applications. Jiří Tulach tulach@position.cz http://controlsjs.com
  • 32. Position s.r.o. (Ltd.) - Creator of Controls.js • History – Founded in 2000 – Applications and services focused on electronic maps – SaaS web application provider since 2005 – Controls.js technology since 2008 (made public in 2014) • Customers – Vodafone, T-Mobile, Telefónica O2, ČEZ Group, ... • Partners – HERE (formerly known as NAVTEQ and NOKIA Location & Commerce) 32
  • 33. Why Controls.js? • Standard web application development – Switching between HTML, CSS and JavaScript – Code sharing? – Dealing with cross-browser incompatibilities 33
  • 34. Why Controls.js? • Standard web application development – Switching between HTML, CSS and JavaScript – Code sharing? – Dealing with cross-browser incompatibilities • Controls.js application development – JavaScript only (No HTML, CSS needed only when creating Skins) – Component based (No DOM) ● create new components based on existing ones – Cross-browser ● IE6+, FF 2+, Opera 9.26+, Chrome, Safari 34
  • 35. But Controls.js can do more... • Touch support – Supports gestures, unifies touch and mouse events • Multi-device development – GUI adjustments and JavaScript loading based on detected device type – Optimized for Apache Cordova/PhoneGap • Localization – Resource strings, GUI adjustments • Model-View-ViewModel (MVVM) – Knockout.js bindings – ViewModel's typed properties handles parsing, formatting and validation 35
  • 36. ...a lot more • Application state handling • Server communication - GET/POST Request/Data/JSON, Script, IFRAME, Auto • Asynchronous script loader • Support for CSS sprite images • Functions for objects duplication and merging • Functions for URL escaping and HTML encoding/decoding • etc. 36
  • 37. 37 var AppForm = null; function ngMain() { AppForm = new ngControls({ Edit1: { Type: 'weEdit', L: 20, T: 20, W: 200, Data: { Text: 'Hello, world!' } } }); AppForm.Update(); } Hello World
  • 38. Usable controls • More than 100 visual and non-visual controls – Buttons, Edit Boxes, Labels, Panels, Lists, Windows, Menus, … – 3 different Skins • Easy creation of new controls – Create new controls based on existing ones – Define only new visual styles (new skins) – In application ad-hoc controls – Encapsulate 3rd party components (CodeMirror, amCharts) 38
  • 41. Usable controls (partial sample) 41 Chart controls are using 3rd party library amCharts http://www.amcharts.c om
  • 42. Controls.js Tools – Form Editor • WYSIWIG editor • Controls.js application • Instant updates code ↔ preview ↔ properties • Beta version available http://formeditor.controlsjs.com 42
  • 43. Controls.js Tools – Skin Editor • CSS sprite definition • Controls.js application 43
  • 44. Application for Slovak Telekom – Desktop version 44
  • 45. Mobile version – Mobile web / Apache Cordova application 45 Shares more than 90% of code with desktop version.
  • 46. Controls.js 4 Java • Controls4j Package – Integration based on Knockout.js (MVVM) – Goal is to minimize usage of JavaScript – Glues GUI defined in .ng files with DukeScript @Model classes • NetBeans Controls.js 4 Java plug-in – Integrates Controls.js Form Editor into NetBeans (associated with .ng files) 46
  • 47. Demo: Controls.js 4 Java 47 Building Controls.js Java Application
  • 48. 48 Questions? Controls.js 4 Java: GUI for DukeScript DukeScript: Write Once, Display Anywhere!