SlideShare una empresa de Scribd logo
1 de 34
XML-Free Programming : Java Server and Client Development Without <> Stephen Chin Chief Agile Methodologist, GXS steveonjava@gmail.com tweet: @steveonjava Arun Gupta Oracle Corporation arun.p.gupta@oracle.com tweet: @arungupta
Meet the Presenters Stephen Chin Arun Gupta Community Guy Family Man Motorcyclist Marathoner
Our Plan Quick (Humorous) History of Angle Brackets XML-Free Programming Configuration Lives with the Code Data Transfer Models the Domain Design Programming Languages for Humans JavaOne Speakers Application <Demo> 3
Exhibit A – Angle Bracket Sighting in Virginia, 1922 Source: Library of Congress, Prints and Photographs Collection – Public Domain http://www.flickr.com/photos/pingnews/434444310/ 4 > > >
Exhibit B - Bermuda Tri-Angle Brackets Source: NOAA National Ocean Service – CC licensed http://www.flickr.com/photos/usoceangov/4276194691/sizes/o/in/photostream/ 5 > > >
Exhibit C – Tim Bray, Co-Founder of XML Source: Linux.com http://www.linux.com/archive/feature/133149 6 > > > >
History of XML Based on Standard Generalized Markup Language (SGML) Created by a W3C working group of eleven members Version History: XML 1.0 (1998) – Widely adopted with 5 subsequent revisions XML 1.1 (2004) – Limited adoption 7
XML Design Goals (a.k.a. problems with SGML) Usable Over the Internet Support a Wide Variety of Applications Compatible with SGML Easy to Write Programs to Process XML Documents Minimum Number of Optional Features Documents Should be Human-Legible and Reasonably Clear Design Should be Prepared Quickly Design Should be Formal and Concise Documents Should be Easy to Create Terseness in Markup is of Minimal Importance 8
Design Goals Per Application 9
Tenet 1 Configuration Lives with the Code 10
Letting Go of XML is Hard! 11 This is not intended as a replacement for Spring's XML format. Rod Johnson on Spring’s Annotations-based Configuration “A Java configuration option for Spring,” 11/28/06
Java EE 6 Annotations @Stateless @Path @WebServlet @Inject @Named @Entity 12
But There is Hope! 13 You can have a Groovy DSL … it is as short as can be. Dierk Koenig on Canoo Web Test “Interview with Dierk Koenig,” ThirstyHead.com 6/3/2009
Canoo Web Test Comparison XML Groovy Builder <project default="test">  <target name="test">  <webtest        name="Google WebTest Search">    <invoke url="http://www.google.com/ncr" />    <verifyTitle text="Google" />    <setInputField name="q" value="WebTest" />    <clickButton label="I'm Feeling Lucky" />    <verifyTitle text="Canoo WebTest" />  </webtest> </target></project> class SimpleTest extends WebtestCase { void testWebtestOnGoogle() {  webtest("Google WebTestSearch") {   invoke "http://www.google.com/ncr"   verifyTitle "Google"   setInputField name: "q", value: "WebTest"   clickButton "I'm Feeling Lucky"   verifyTitle "CanooWebTest"  } }} 14
Tenet 2 Data Transfer Models the Domain 15
JavaScript Object Notation (JSON) Matches Relational/Object-Oriented Structures Easy to Read and Write Simple to Parse and Generate Familiar to Programmers of the C-family of languages: C, C++, C#, Java, JavaScript, Perl, Python, etc. Very Simple Specification 16
JSON Syntax in a Slide 17 Images courtesy: http://www.json.org/
JAX-RS Sample 18 @GET     @Produces({"application/json", "application/xml"})     public List<Sezzion> findAll() {         return super.findAll();     }     @GET @Path("{from}/{to}")     @Produces({"application/xml", "application/json"})     public List<Sezzion> findRange(@PathParam("from") Integer from, @PathParam("to") Integer to) {         return super.findRange(new int[]{from, to});     } @Stateless @Path("sezzion") public class SezzionFacadeREST extends AbstractFacade<Sezzion> { @PersistenceContext     private EntityManagerem; @POST @Consumes({"application/json", "application/xml"})     public void create(Sezzion entity) { super.create(entity);     }
Tenet 3 Design Programming Languages for Humans 19
Counter Example – o:XML Created By Martin Klang in 2002 Object Oriented Language Features: Poymorphism Function Overloading Exception Handling Threads 20 Diagram from: http://www.o-xml.org/documentation/o-xml-tool-chain.html
String Replacement in o:XML vs. Java <?xml-stylesheethref="../xsl/default.xsl" type="text/xsl"?> <program>   <o:function name="ex:replace">     <o:param name="input" type="String"/>     <o:param name="from" type="String"/>     <o:param name="to" type="String"/>     <o:do>       <o:variable name="result"/>       <o:while test="contains($input, $from)">         <o:set result="concat($result, substring-before($input, $from), $to)"/>         <o:set input="substring-after($input, $from)"/>       </o:while>       <o:return select="concat($result, $input)"/>     </o:do>   </o:function> </program> class Replace {   public String replace(String input, String from, String to) { StringBuilder result = new StringBuilder(); int last = 0; int index = 0;     while ((index = input.indexOf(from, last)) != -1) { result.append(input.substring(last, index)); result.append(to);       last = index + from.length()     } result.append(input.substring(last));     return result.toString();   } } 21 16 Lines 461 Characters 14 Lines 319 Characters
String Replacement in o:XML <?xml-stylesheethref="../xsl/default.xsl" type="text/xsl"?> <program>   <o:function name="ex:replace">     <o:param name="input" type="String"/>     <o:param name="from" type="String"/>     <o:param name="to" type="String"/>    <o:do>      <o:variable name="result"/>      <o:while test="contains($input, $from)">        <o:set result="concat($result, substring-before($input, $from), $to)"/>        <o:set input="substring-after($input, $from)"/>      </o:while>      <o:return select="concat($result, $input)"/>    </o:do>   </o:function> </program> 22
Equivalent Java class Replace {   public String replace(String input, String from, String to) { StringBuilder result = new StringBuilder(); int last = 0; int index = 0;     while ((index = input.indexOf(from, last)) != -1) { result.append(input.substring(last, index)); result.append(to);      last = index + from.length()    } result.append(input.substring(last));    return result.toString();   } } 23
Simple Java class Replace {   public String replace(String input, String from, String to) {    return input.replaceAll(from, to)   } } 24
JavaFX 2.0 Powerful graphics, animation, and media capabilities Deploys in the browser or on desktop Includes builders for declarative construction Alternative languages can also be used for simpler UI creation GroovyFX ScalaFX Visage 25
26 Hello JavaOne (Java Version) public class HelloJavaOne extends Application {   public static void main(String[] args) {     launch(HelloJavaOne.class, args);   }   @Override   public void start(Stage primaryStage) { primaryStage.setTitle("Hello JavaOne");     Group root = new Group();     Scene scene = new Scene(root, 400, 250, Color.ALICEBLUE);     Text text = new Text(); text.setX(105); text.setY(120); text.setFont(new Font(30)); text.setText("Hello JavaOne"); root.getChildren().add(text);         primaryStage.setScene(scene); primaryStage.show();   } }
27 Hello JavaOne(Builder Version) public void start(Stage primaryStage) { primaryStage.setTitle("Hello JavaOne"); primaryStage.setScene(SceneBuilder.create()     .width(400)     .height(250)     .fill(Color.ALICEBLUE)     .root( GroupBuilder.create().children( TextBuilder.create()         .x(105) .y(120)         .text("Hello JavaOne")         .font(new Font(30))         .build()       ).build()     )   .build()); primaryStage.show(); }
28 Hello JavaOne (GroovyFX Version) GroovyFX.start { primaryStage -> defsg = new SceneGraphBuilder() sg.stage(    title: 'Hello JavaOne',    show: true) {   scene(        fill: aliceblue,        width: 400,        height: 250) {     text(            x: 105,            y: 120,            text: "Hello JavaOne"            font: "30pt")     }   } }
29 Hello JavaOne (ScalaFX Version) object HelloJavaOne extends JFXApp {   stage = new Stage {     title = "Hello JavaFX"     width = 400     height = 250     scene = new Scene {       fill = BLUE      Text {        x = 105        y = 120         text = "Hello JavaOne"        font = Font(size: 30)      }     }   } }
30 Hello JavaOne (Visage Version) Stage { title: "Hello JavaOne" width: 400 height: 250 scene: Scene {   fill: BLUE   content: Text {      x: 105      y: 120      text: "Hello JavaOne"       font: Font {size: 30pt}    }   } }
JavaOne Speakers Application End-to-end application with no XML coding Server written using JavaEE 6 annotations Data transfer uses JSON Client written in JavaFX 2.0 31
Finished Application 32
Support the Freedom From XML Petition http://steveonjava.com/freedom-from-xml/ Provide Non-XML Alternatives For: Declarative Programming Configuration Data Transfer 33 </> Sign the Petition Today!
34 Stephen Chin steveonjava@gmail.com tweet: @steveonjava Arun Gupta arun.p.gupta@oracle.com tweet: @arungupta

Más contenido relacionado

La actualidad más candente

Groovy, Transforming Language
Groovy, Transforming LanguageGroovy, Transforming Language
Groovy, Transforming LanguageUehara Junji
 
企业级软件的组件化和动态化开发实践
企业级软件的组件化和动态化开发实践企业级软件的组件化和动态化开发实践
企业级软件的组件化和动态化开发实践Jacky Chi
 
FP - Découverte de Play Framework Scala
FP - Découverte de Play Framework ScalaFP - Découverte de Play Framework Scala
FP - Découverte de Play Framework ScalaKévin Margueritte
 
EWD 3 Training Course Part 14: Using Ajax for QEWD Messages
EWD 3 Training Course Part 14: Using Ajax for QEWD MessagesEWD 3 Training Course Part 14: Using Ajax for QEWD Messages
EWD 3 Training Course Part 14: Using Ajax for QEWD MessagesRob Tweed
 
Performance Improvements in Browsers
Performance Improvements in BrowsersPerformance Improvements in Browsers
Performance Improvements in Browsersjeresig
 
Java EE 7: Boosting Productivity and Embracing HTML5
Java EE 7: Boosting Productivity and Embracing HTML5Java EE 7: Boosting Productivity and Embracing HTML5
Java EE 7: Boosting Productivity and Embracing HTML5Arun Gupta
 
Lecture 8 - Qooxdoo - Rap Course At The University Of Szeged
Lecture 8 - Qooxdoo - Rap Course At The University Of SzegedLecture 8 - Qooxdoo - Rap Course At The University Of Szeged
Lecture 8 - Qooxdoo - Rap Course At The University Of SzegedFabian Jakobs
 
LISA Qooxdoo Tutorial Handouts
LISA Qooxdoo Tutorial HandoutsLISA Qooxdoo Tutorial Handouts
LISA Qooxdoo Tutorial HandoutsTobias Oetiker
 
High Performance Django
High Performance DjangoHigh Performance Django
High Performance DjangoDjangoCon2008
 
Information security programming in ruby
Information security programming in rubyInformation security programming in ruby
Information security programming in rubyHiroshi Nakamura
 
Cracking JWT tokens: a tale of magic, Node.JS and parallel computing
Cracking JWT tokens: a tale of magic, Node.JS and parallel computingCracking JWT tokens: a tale of magic, Node.JS and parallel computing
Cracking JWT tokens: a tale of magic, Node.JS and parallel computingLuciano Mammino
 
HTML5 JavaScript APIs
HTML5 JavaScript APIsHTML5 JavaScript APIs
HTML5 JavaScript APIsRemy Sharp
 
Open Source Ajax Solution @OSDC.tw 2009
Open Source Ajax  Solution @OSDC.tw 2009Open Source Ajax  Solution @OSDC.tw 2009
Open Source Ajax Solution @OSDC.tw 2009Robbie Cheng
 
Django Rest Framework and React and Redux, Oh My!
Django Rest Framework and React and Redux, Oh My!Django Rest Framework and React and Redux, Oh My!
Django Rest Framework and React and Redux, Oh My!Eric Palakovich Carr
 
Sqladria 2009 SRC
Sqladria 2009 SRCSqladria 2009 SRC
Sqladria 2009 SRCtepsum
 
From framework coupled code to #microservices through #DDD /by @codelytv
From framework coupled code to #microservices through #DDD /by @codelytvFrom framework coupled code to #microservices through #DDD /by @codelytv
From framework coupled code to #microservices through #DDD /by @codelytvCodelyTV
 
PECL Picks - Extensions to make your life better
PECL Picks - Extensions to make your life betterPECL Picks - Extensions to make your life better
PECL Picks - Extensions to make your life betterZendCon
 
Web前端标准在各浏览器中的实现差异
Web前端标准在各浏览器中的实现差异Web前端标准在各浏览器中的实现差异
Web前端标准在各浏览器中的实现差异Open Party
 
ES6, 잘 쓰고 계시죠?
ES6, 잘 쓰고 계시죠?ES6, 잘 쓰고 계시죠?
ES6, 잘 쓰고 계시죠?장현 한
 

La actualidad más candente (20)

Groovy, Transforming Language
Groovy, Transforming LanguageGroovy, Transforming Language
Groovy, Transforming Language
 
企业级软件的组件化和动态化开发实践
企业级软件的组件化和动态化开发实践企业级软件的组件化和动态化开发实践
企业级软件的组件化和动态化开发实践
 
FP - Découverte de Play Framework Scala
FP - Découverte de Play Framework ScalaFP - Découverte de Play Framework Scala
FP - Découverte de Play Framework Scala
 
EWD 3 Training Course Part 14: Using Ajax for QEWD Messages
EWD 3 Training Course Part 14: Using Ajax for QEWD MessagesEWD 3 Training Course Part 14: Using Ajax for QEWD Messages
EWD 3 Training Course Part 14: Using Ajax for QEWD Messages
 
Performance Improvements in Browsers
Performance Improvements in BrowsersPerformance Improvements in Browsers
Performance Improvements in Browsers
 
Java EE 7: Boosting Productivity and Embracing HTML5
Java EE 7: Boosting Productivity and Embracing HTML5Java EE 7: Boosting Productivity and Embracing HTML5
Java EE 7: Boosting Productivity and Embracing HTML5
 
Lecture 8 - Qooxdoo - Rap Course At The University Of Szeged
Lecture 8 - Qooxdoo - Rap Course At The University Of SzegedLecture 8 - Qooxdoo - Rap Course At The University Of Szeged
Lecture 8 - Qooxdoo - Rap Course At The University Of Szeged
 
LISA Qooxdoo Tutorial Handouts
LISA Qooxdoo Tutorial HandoutsLISA Qooxdoo Tutorial Handouts
LISA Qooxdoo Tutorial Handouts
 
High Performance Django
High Performance DjangoHigh Performance Django
High Performance Django
 
Information security programming in ruby
Information security programming in rubyInformation security programming in ruby
Information security programming in ruby
 
Cracking JWT tokens: a tale of magic, Node.JS and parallel computing
Cracking JWT tokens: a tale of magic, Node.JS and parallel computingCracking JWT tokens: a tale of magic, Node.JS and parallel computing
Cracking JWT tokens: a tale of magic, Node.JS and parallel computing
 
HTML5 JavaScript APIs
HTML5 JavaScript APIsHTML5 JavaScript APIs
HTML5 JavaScript APIs
 
Open Source Ajax Solution @OSDC.tw 2009
Open Source Ajax  Solution @OSDC.tw 2009Open Source Ajax  Solution @OSDC.tw 2009
Open Source Ajax Solution @OSDC.tw 2009
 
Django Rest Framework and React and Redux, Oh My!
Django Rest Framework and React and Redux, Oh My!Django Rest Framework and React and Redux, Oh My!
Django Rest Framework and React and Redux, Oh My!
 
Sqladria 2009 SRC
Sqladria 2009 SRCSqladria 2009 SRC
Sqladria 2009 SRC
 
From framework coupled code to #microservices through #DDD /by @codelytv
From framework coupled code to #microservices through #DDD /by @codelytvFrom framework coupled code to #microservices through #DDD /by @codelytv
From framework coupled code to #microservices through #DDD /by @codelytv
 
PECL Picks - Extensions to make your life better
PECL Picks - Extensions to make your life betterPECL Picks - Extensions to make your life better
PECL Picks - Extensions to make your life better
 
Spring 4 - A&BP CC
Spring 4 - A&BP CCSpring 4 - A&BP CC
Spring 4 - A&BP CC
 
Web前端标准在各浏览器中的实现差异
Web前端标准在各浏览器中的实现差异Web前端标准在各浏览器中的实现差异
Web前端标准在各浏览器中的实现差异
 
ES6, 잘 쓰고 계시죠?
ES6, 잘 쓰고 계시죠?ES6, 잘 쓰고 계시죠?
ES6, 잘 쓰고 계시죠?
 

Destacado

Hacking JavaFX with Groovy, Clojure, Scala, and Visage
Hacking JavaFX with Groovy, Clojure, Scala, and VisageHacking JavaFX with Groovy, Clojure, Scala, and Visage
Hacking JavaFX with Groovy, Clojure, Scala, and VisageStephen Chin
 
XML Free Programming - Brazil
XML Free Programming - BrazilXML Free Programming - Brazil
XML Free Programming - BrazilStephen Chin
 
Mary Had a Little λ (QCon)
Mary Had a Little λ (QCon)Mary Had a Little λ (QCon)
Mary Had a Little λ (QCon)Stephen Chin
 
55 New Things in Java 7 - Brazil
55 New Things in Java 7 - Brazil55 New Things in Java 7 - Brazil
55 New Things in Java 7 - BrazilStephen Chin
 
JCrete Embedded Java Workshop
JCrete Embedded Java WorkshopJCrete Embedded Java Workshop
JCrete Embedded Java WorkshopStephen Chin
 

Destacado (6)

Hacking JavaFX with Groovy, Clojure, Scala, and Visage
Hacking JavaFX with Groovy, Clojure, Scala, and VisageHacking JavaFX with Groovy, Clojure, Scala, and Visage
Hacking JavaFX with Groovy, Clojure, Scala, and Visage
 
XML Free Programming - Brazil
XML Free Programming - BrazilXML Free Programming - Brazil
XML Free Programming - Brazil
 
Mary Had a Little λ (QCon)
Mary Had a Little λ (QCon)Mary Had a Little λ (QCon)
Mary Had a Little λ (QCon)
 
55 New Things in Java 7 - Brazil
55 New Things in Java 7 - Brazil55 New Things in Java 7 - Brazil
55 New Things in Java 7 - Brazil
 
Crazy JSRs
Crazy JSRsCrazy JSRs
Crazy JSRs
 
JCrete Embedded Java Workshop
JCrete Embedded Java WorkshopJCrete Embedded Java Workshop
JCrete Embedded Java Workshop
 

Similar a XML-Free Programming

ActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group PresentationActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group Presentationipolevoy
 
Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008Guillaume Laforge
 
Interoperable Web Services with JAX-WS
Interoperable Web Services with JAX-WSInteroperable Web Services with JAX-WS
Interoperable Web Services with JAX-WSCarol McDonald
 
Intro to JavaFX & Widget FX
Intro to JavaFX & Widget FXIntro to JavaFX & Widget FX
Intro to JavaFX & Widget FXStephen Chin
 
Scripting Oracle Develop 2007
Scripting Oracle Develop 2007Scripting Oracle Develop 2007
Scripting Oracle Develop 2007Tugdual Grall
 
當ZK遇見Front-End
當ZK遇見Front-End當ZK遇見Front-End
當ZK遇見Front-End祁源 朱
 
Introduction to JSF
Introduction toJSFIntroduction toJSF
Introduction to JSFSoftServe
 
Client-side JavaScript Vulnerabilities
Client-side JavaScript VulnerabilitiesClient-side JavaScript Vulnerabilities
Client-side JavaScript VulnerabilitiesOry Segal
 
Introduction To Groovy 2005
Introduction To Groovy 2005Introduction To Groovy 2005
Introduction To Groovy 2005Tugdual Grall
 
Basic testing with selenium
Basic testing with seleniumBasic testing with selenium
Basic testing with seleniumSøren Lund
 
Bring the fun back to java
Bring the fun back to javaBring the fun back to java
Bring the fun back to javaciklum_ods
 
GDG Jakarta Meetup - Streaming Analytics With Apache Beam
GDG Jakarta Meetup - Streaming Analytics With Apache BeamGDG Jakarta Meetup - Streaming Analytics With Apache Beam
GDG Jakarta Meetup - Streaming Analytics With Apache BeamImre Nagi
 
Google's HTML5 Work: what's next?
Google's HTML5 Work: what's next?Google's HTML5 Work: what's next?
Google's HTML5 Work: what's next?Patrick Chanezon
 
Migrating from Struts 1 to Struts 2
Migrating from Struts 1 to Struts 2Migrating from Struts 1 to Struts 2
Migrating from Struts 1 to Struts 2Matt Raible
 
Graphics programming in Java
Graphics programming in JavaGraphics programming in Java
Graphics programming in JavaTushar B Kute
 

Similar a XML-Free Programming (20)

ActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group PresentationActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group Presentation
 
Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008
 
Interoperable Web Services with JAX-WS
Interoperable Web Services with JAX-WSInteroperable Web Services with JAX-WS
Interoperable Web Services with JAX-WS
 
Intro to JavaFX & Widget FX
Intro to JavaFX & Widget FXIntro to JavaFX & Widget FX
Intro to JavaFX & Widget FX
 
Scripting Oracle Develop 2007
Scripting Oracle Develop 2007Scripting Oracle Develop 2007
Scripting Oracle Develop 2007
 
My java file
My java fileMy java file
My java file
 
當ZK遇見Front-End
當ZK遇見Front-End當ZK遇見Front-End
當ZK遇見Front-End
 
Introduction to JSF
Introduction toJSFIntroduction toJSF
Introduction to JSF
 
Client-side JavaScript Vulnerabilities
Client-side JavaScript VulnerabilitiesClient-side JavaScript Vulnerabilities
Client-side JavaScript Vulnerabilities
 
Os Secoske
Os SecoskeOs Secoske
Os Secoske
 
Introduction To Groovy 2005
Introduction To Groovy 2005Introduction To Groovy 2005
Introduction To Groovy 2005
 
mobl
moblmobl
mobl
 
Basic testing with selenium
Basic testing with seleniumBasic testing with selenium
Basic testing with selenium
 
Bring the fun back to java
Bring the fun back to javaBring the fun back to java
Bring the fun back to java
 
GDG Jakarta Meetup - Streaming Analytics With Apache Beam
GDG Jakarta Meetup - Streaming Analytics With Apache BeamGDG Jakarta Meetup - Streaming Analytics With Apache Beam
GDG Jakarta Meetup - Streaming Analytics With Apache Beam
 
GWT Extreme!
GWT Extreme!GWT Extreme!
GWT Extreme!
 
Google's HTML5 Work: what's next?
Google's HTML5 Work: what's next?Google's HTML5 Work: what's next?
Google's HTML5 Work: what's next?
 
Migrating from Struts 1 to Struts 2
Migrating from Struts 1 to Struts 2Migrating from Struts 1 to Struts 2
Migrating from Struts 1 to Struts 2
 
Graphics programming in Java
Graphics programming in JavaGraphics programming in Java
Graphics programming in Java
 
Nativescript angular
Nativescript angularNativescript angular
Nativescript angular
 

Más de Stephen Chin

DevOps Tools for Java Developers v2
DevOps Tools for Java Developers v2DevOps Tools for Java Developers v2
DevOps Tools for Java Developers v2Stephen Chin
 
10 Ways Everyone Can Support the Java Community
10 Ways Everyone Can Support the Java Community10 Ways Everyone Can Support the Java Community
10 Ways Everyone Can Support the Java CommunityStephen Chin
 
Java Clients and JavaFX: The Definitive Guide
Java Clients and JavaFX: The Definitive GuideJava Clients and JavaFX: The Definitive Guide
Java Clients and JavaFX: The Definitive GuideStephen Chin
 
DevOps Tools for Java Developers
DevOps Tools for Java DevelopersDevOps Tools for Java Developers
DevOps Tools for Java DevelopersStephen Chin
 
Java Clients and JavaFX - Presented to LJC
Java Clients and JavaFX - Presented to LJCJava Clients and JavaFX - Presented to LJC
Java Clients and JavaFX - Presented to LJCStephen Chin
 
RetroPi Handheld Raspberry Pi Gaming Console
RetroPi Handheld Raspberry Pi Gaming ConsoleRetroPi Handheld Raspberry Pi Gaming Console
RetroPi Handheld Raspberry Pi Gaming ConsoleStephen Chin
 
JavaFX on Mobile (by Johan Vos)
JavaFX on Mobile (by Johan Vos)JavaFX on Mobile (by Johan Vos)
JavaFX on Mobile (by Johan Vos)Stephen Chin
 
Confessions of a Former Agile Methodologist (JFrog Edition)
Confessions of a Former Agile Methodologist (JFrog Edition)Confessions of a Former Agile Methodologist (JFrog Edition)
Confessions of a Former Agile Methodologist (JFrog Edition)Stephen Chin
 
Devoxx4Kids Lego Workshop
Devoxx4Kids Lego WorkshopDevoxx4Kids Lego Workshop
Devoxx4Kids Lego WorkshopStephen Chin
 
Raspberry Pi with Java (JJUG)
Raspberry Pi with Java (JJUG)Raspberry Pi with Java (JJUG)
Raspberry Pi with Java (JJUG)Stephen Chin
 
Confessions of a Former Agile Methodologist
Confessions of a Former Agile MethodologistConfessions of a Former Agile Methodologist
Confessions of a Former Agile MethodologistStephen Chin
 
Internet of Things Magic Show
Internet of Things Magic ShowInternet of Things Magic Show
Internet of Things Magic ShowStephen Chin
 
Zombie Time - JSR 310 for the Undead
Zombie Time - JSR 310 for the UndeadZombie Time - JSR 310 for the Undead
Zombie Time - JSR 310 for the UndeadStephen Chin
 
Oracle IoT Kids Workshop
Oracle IoT Kids WorkshopOracle IoT Kids Workshop
Oracle IoT Kids WorkshopStephen Chin
 
OpenJFX on Android and Devices
OpenJFX on Android and DevicesOpenJFX on Android and Devices
OpenJFX on Android and DevicesStephen Chin
 
Java on Raspberry Pi Lab
Java on Raspberry Pi LabJava on Raspberry Pi Lab
Java on Raspberry Pi LabStephen Chin
 
Java 8 for Tablets, Pis, and Legos
Java 8 for Tablets, Pis, and LegosJava 8 for Tablets, Pis, and Legos
Java 8 for Tablets, Pis, and LegosStephen Chin
 
Devoxx4Kids NAO Workshop
Devoxx4Kids NAO WorkshopDevoxx4Kids NAO Workshop
Devoxx4Kids NAO WorkshopStephen Chin
 
Raspberry Pi Gaming 4 Kids (Devoxx4Kids)
Raspberry Pi Gaming 4 Kids (Devoxx4Kids)Raspberry Pi Gaming 4 Kids (Devoxx4Kids)
Raspberry Pi Gaming 4 Kids (Devoxx4Kids)Stephen Chin
 

Más de Stephen Chin (20)

DevOps Tools for Java Developers v2
DevOps Tools for Java Developers v2DevOps Tools for Java Developers v2
DevOps Tools for Java Developers v2
 
10 Ways Everyone Can Support the Java Community
10 Ways Everyone Can Support the Java Community10 Ways Everyone Can Support the Java Community
10 Ways Everyone Can Support the Java Community
 
Java Clients and JavaFX: The Definitive Guide
Java Clients and JavaFX: The Definitive GuideJava Clients and JavaFX: The Definitive Guide
Java Clients and JavaFX: The Definitive Guide
 
DevOps Tools for Java Developers
DevOps Tools for Java DevelopersDevOps Tools for Java Developers
DevOps Tools for Java Developers
 
Java Clients and JavaFX - Presented to LJC
Java Clients and JavaFX - Presented to LJCJava Clients and JavaFX - Presented to LJC
Java Clients and JavaFX - Presented to LJC
 
RetroPi Handheld Raspberry Pi Gaming Console
RetroPi Handheld Raspberry Pi Gaming ConsoleRetroPi Handheld Raspberry Pi Gaming Console
RetroPi Handheld Raspberry Pi Gaming Console
 
JavaFX on Mobile (by Johan Vos)
JavaFX on Mobile (by Johan Vos)JavaFX on Mobile (by Johan Vos)
JavaFX on Mobile (by Johan Vos)
 
Confessions of a Former Agile Methodologist (JFrog Edition)
Confessions of a Former Agile Methodologist (JFrog Edition)Confessions of a Former Agile Methodologist (JFrog Edition)
Confessions of a Former Agile Methodologist (JFrog Edition)
 
Devoxx4Kids Lego Workshop
Devoxx4Kids Lego WorkshopDevoxx4Kids Lego Workshop
Devoxx4Kids Lego Workshop
 
Raspberry Pi with Java (JJUG)
Raspberry Pi with Java (JJUG)Raspberry Pi with Java (JJUG)
Raspberry Pi with Java (JJUG)
 
Confessions of a Former Agile Methodologist
Confessions of a Former Agile MethodologistConfessions of a Former Agile Methodologist
Confessions of a Former Agile Methodologist
 
Internet of Things Magic Show
Internet of Things Magic ShowInternet of Things Magic Show
Internet of Things Magic Show
 
Zombie Time - JSR 310 for the Undead
Zombie Time - JSR 310 for the UndeadZombie Time - JSR 310 for the Undead
Zombie Time - JSR 310 for the Undead
 
Oracle IoT Kids Workshop
Oracle IoT Kids WorkshopOracle IoT Kids Workshop
Oracle IoT Kids Workshop
 
OpenJFX on Android and Devices
OpenJFX on Android and DevicesOpenJFX on Android and Devices
OpenJFX on Android and Devices
 
Java on Raspberry Pi Lab
Java on Raspberry Pi LabJava on Raspberry Pi Lab
Java on Raspberry Pi Lab
 
Java 8 for Tablets, Pis, and Legos
Java 8 for Tablets, Pis, and LegosJava 8 for Tablets, Pis, and Legos
Java 8 for Tablets, Pis, and Legos
 
DukeScript
DukeScriptDukeScript
DukeScript
 
Devoxx4Kids NAO Workshop
Devoxx4Kids NAO WorkshopDevoxx4Kids NAO Workshop
Devoxx4Kids NAO Workshop
 
Raspberry Pi Gaming 4 Kids (Devoxx4Kids)
Raspberry Pi Gaming 4 Kids (Devoxx4Kids)Raspberry Pi Gaming 4 Kids (Devoxx4Kids)
Raspberry Pi Gaming 4 Kids (Devoxx4Kids)
 

Último

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 

Último (20)

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 

XML-Free Programming

  • 1. XML-Free Programming : Java Server and Client Development Without <> Stephen Chin Chief Agile Methodologist, GXS steveonjava@gmail.com tweet: @steveonjava Arun Gupta Oracle Corporation arun.p.gupta@oracle.com tweet: @arungupta
  • 2. Meet the Presenters Stephen Chin Arun Gupta Community Guy Family Man Motorcyclist Marathoner
  • 3. Our Plan Quick (Humorous) History of Angle Brackets XML-Free Programming Configuration Lives with the Code Data Transfer Models the Domain Design Programming Languages for Humans JavaOne Speakers Application <Demo> 3
  • 4. Exhibit A – Angle Bracket Sighting in Virginia, 1922 Source: Library of Congress, Prints and Photographs Collection – Public Domain http://www.flickr.com/photos/pingnews/434444310/ 4 > > >
  • 5. Exhibit B - Bermuda Tri-Angle Brackets Source: NOAA National Ocean Service – CC licensed http://www.flickr.com/photos/usoceangov/4276194691/sizes/o/in/photostream/ 5 > > >
  • 6. Exhibit C – Tim Bray, Co-Founder of XML Source: Linux.com http://www.linux.com/archive/feature/133149 6 > > > >
  • 7. History of XML Based on Standard Generalized Markup Language (SGML) Created by a W3C working group of eleven members Version History: XML 1.0 (1998) – Widely adopted with 5 subsequent revisions XML 1.1 (2004) – Limited adoption 7
  • 8. XML Design Goals (a.k.a. problems with SGML) Usable Over the Internet Support a Wide Variety of Applications Compatible with SGML Easy to Write Programs to Process XML Documents Minimum Number of Optional Features Documents Should be Human-Legible and Reasonably Clear Design Should be Prepared Quickly Design Should be Formal and Concise Documents Should be Easy to Create Terseness in Markup is of Minimal Importance 8
  • 9. Design Goals Per Application 9
  • 10. Tenet 1 Configuration Lives with the Code 10
  • 11. Letting Go of XML is Hard! 11 This is not intended as a replacement for Spring's XML format. Rod Johnson on Spring’s Annotations-based Configuration “A Java configuration option for Spring,” 11/28/06
  • 12. Java EE 6 Annotations @Stateless @Path @WebServlet @Inject @Named @Entity 12
  • 13. But There is Hope! 13 You can have a Groovy DSL … it is as short as can be. Dierk Koenig on Canoo Web Test “Interview with Dierk Koenig,” ThirstyHead.com 6/3/2009
  • 14. Canoo Web Test Comparison XML Groovy Builder <project default="test"> <target name="test"> <webtest        name="Google WebTest Search">    <invoke url="http://www.google.com/ncr" />    <verifyTitle text="Google" />    <setInputField name="q" value="WebTest" />    <clickButton label="I'm Feeling Lucky" />    <verifyTitle text="Canoo WebTest" />  </webtest> </target></project> class SimpleTest extends WebtestCase { void testWebtestOnGoogle() {  webtest("Google WebTestSearch") {   invoke "http://www.google.com/ncr"   verifyTitle "Google"   setInputField name: "q", value: "WebTest"   clickButton "I'm Feeling Lucky"   verifyTitle "CanooWebTest"  } }} 14
  • 15. Tenet 2 Data Transfer Models the Domain 15
  • 16. JavaScript Object Notation (JSON) Matches Relational/Object-Oriented Structures Easy to Read and Write Simple to Parse and Generate Familiar to Programmers of the C-family of languages: C, C++, C#, Java, JavaScript, Perl, Python, etc. Very Simple Specification 16
  • 17. JSON Syntax in a Slide 17 Images courtesy: http://www.json.org/
  • 18. JAX-RS Sample 18 @GET @Produces({"application/json", "application/xml"}) public List<Sezzion> findAll() { return super.findAll(); } @GET @Path("{from}/{to}") @Produces({"application/xml", "application/json"}) public List<Sezzion> findRange(@PathParam("from") Integer from, @PathParam("to") Integer to) { return super.findRange(new int[]{from, to}); } @Stateless @Path("sezzion") public class SezzionFacadeREST extends AbstractFacade<Sezzion> { @PersistenceContext private EntityManagerem; @POST @Consumes({"application/json", "application/xml"}) public void create(Sezzion entity) { super.create(entity); }
  • 19. Tenet 3 Design Programming Languages for Humans 19
  • 20. Counter Example – o:XML Created By Martin Klang in 2002 Object Oriented Language Features: Poymorphism Function Overloading Exception Handling Threads 20 Diagram from: http://www.o-xml.org/documentation/o-xml-tool-chain.html
  • 21. String Replacement in o:XML vs. Java <?xml-stylesheethref="../xsl/default.xsl" type="text/xsl"?> <program> <o:function name="ex:replace"> <o:param name="input" type="String"/> <o:param name="from" type="String"/> <o:param name="to" type="String"/> <o:do> <o:variable name="result"/> <o:while test="contains($input, $from)"> <o:set result="concat($result, substring-before($input, $from), $to)"/> <o:set input="substring-after($input, $from)"/> </o:while> <o:return select="concat($result, $input)"/> </o:do> </o:function> </program> class Replace { public String replace(String input, String from, String to) { StringBuilder result = new StringBuilder(); int last = 0; int index = 0; while ((index = input.indexOf(from, last)) != -1) { result.append(input.substring(last, index)); result.append(to); last = index + from.length() } result.append(input.substring(last)); return result.toString(); } } 21 16 Lines 461 Characters 14 Lines 319 Characters
  • 22. String Replacement in o:XML <?xml-stylesheethref="../xsl/default.xsl" type="text/xsl"?> <program> <o:function name="ex:replace"> <o:param name="input" type="String"/> <o:param name="from" type="String"/> <o:param name="to" type="String"/> <o:do> <o:variable name="result"/> <o:while test="contains($input, $from)"> <o:set result="concat($result, substring-before($input, $from), $to)"/> <o:set input="substring-after($input, $from)"/> </o:while> <o:return select="concat($result, $input)"/> </o:do> </o:function> </program> 22
  • 23. Equivalent Java class Replace { public String replace(String input, String from, String to) { StringBuilder result = new StringBuilder(); int last = 0; int index = 0; while ((index = input.indexOf(from, last)) != -1) { result.append(input.substring(last, index)); result.append(to); last = index + from.length() } result.append(input.substring(last)); return result.toString(); } } 23
  • 24. Simple Java class Replace { public String replace(String input, String from, String to) { return input.replaceAll(from, to) } } 24
  • 25. JavaFX 2.0 Powerful graphics, animation, and media capabilities Deploys in the browser or on desktop Includes builders for declarative construction Alternative languages can also be used for simpler UI creation GroovyFX ScalaFX Visage 25
  • 26. 26 Hello JavaOne (Java Version) public class HelloJavaOne extends Application { public static void main(String[] args) { launch(HelloJavaOne.class, args); } @Override public void start(Stage primaryStage) { primaryStage.setTitle("Hello JavaOne"); Group root = new Group(); Scene scene = new Scene(root, 400, 250, Color.ALICEBLUE); Text text = new Text(); text.setX(105); text.setY(120); text.setFont(new Font(30)); text.setText("Hello JavaOne"); root.getChildren().add(text); primaryStage.setScene(scene); primaryStage.show(); } }
  • 27. 27 Hello JavaOne(Builder Version) public void start(Stage primaryStage) { primaryStage.setTitle("Hello JavaOne"); primaryStage.setScene(SceneBuilder.create() .width(400) .height(250) .fill(Color.ALICEBLUE) .root( GroupBuilder.create().children( TextBuilder.create() .x(105) .y(120) .text("Hello JavaOne") .font(new Font(30)) .build() ).build() ) .build()); primaryStage.show(); }
  • 28. 28 Hello JavaOne (GroovyFX Version) GroovyFX.start { primaryStage -> defsg = new SceneGraphBuilder() sg.stage( title: 'Hello JavaOne', show: true) { scene( fill: aliceblue, width: 400, height: 250) { text( x: 105, y: 120, text: "Hello JavaOne" font: "30pt") } } }
  • 29. 29 Hello JavaOne (ScalaFX Version) object HelloJavaOne extends JFXApp { stage = new Stage { title = "Hello JavaFX" width = 400 height = 250 scene = new Scene { fill = BLUE Text { x = 105 y = 120 text = "Hello JavaOne" font = Font(size: 30) } } } }
  • 30. 30 Hello JavaOne (Visage Version) Stage { title: "Hello JavaOne" width: 400 height: 250 scene: Scene { fill: BLUE content: Text { x: 105 y: 120 text: "Hello JavaOne" font: Font {size: 30pt} } } }
  • 31. JavaOne Speakers Application End-to-end application with no XML coding Server written using JavaEE 6 annotations Data transfer uses JSON Client written in JavaFX 2.0 31
  • 33. Support the Freedom From XML Petition http://steveonjava.com/freedom-from-xml/ Provide Non-XML Alternatives For: Declarative Programming Configuration Data Transfer 33 </> Sign the Petition Today!
  • 34. 34 Stephen Chin steveonjava@gmail.com tweet: @steveonjava Arun Gupta arun.p.gupta@oracle.com tweet: @arungupta