JSF on Rails – JDeveloper 11g, ADF 11g and JHeadstart

Here is my Devoxx 2008 presentation challenge: within 30 minutes, walk an audience through ‘JSF On Rails’ with ADF 11g (the application development framework from Oracle) and JHeadstart – its counterpart to Ruby on Rails and/or Grails plugin that support rapid generation of CRUD++ style applications – into JSF/ADF Faces Rich Client Components. Entice them into trying it out for themselves. By the way: the audience just comes out of the second of two 3 hour-long University sessions.

Tools in action is the name of the track. In 30 minutes presenters get an opportunity to show to an audience what tool combination they think others should see and know about. It calls for a lot of demo and little slide-talk. See the slides at the end of this article.

My story line in summary:

Statement

Java developers spend most of their time on solving non-functional problems that have already been solved:

  •   In other technology stacks
  •   In existing Java frameworks, libraries or tools
  •   By their (former) colleagues
  •   And sometimes even by themselves
  • Over 90% of developer effort can be and should be oriented towards functional business requirements

No focus and little effort on programming generic plumbing code or developing functionality available from frameworks. Exploit declarative, predefined options in your technology stack and start programming in anger to go the ‘extra mile’

ADF – Application Development Framework

  • (rich) JSF implementation (ADF Faces aka MyFaces Trinidad) – as well as ADF Swing and Struts/JSP support
  • its own persistency framework ADF Business Components (fka BC4J) – as well as support for EJB/JPA, EclipseLink/TopLink, WebServices and 3rd party persistency solutions
  • Infrastructure for Data Binding – to decouple Model and ViewController (and implement rich JSF backing models)

Note: each of these elements can be used with or without the others

Demonstration 1
Starting from a JPA persistence implementation, publish the Session Bean as ADF Data Control. Create a new ViewController project and a JSF page in it. Drag and drop a PanelStretchLayout to it. Then drag the EmployeeList within the Department from the Data Control palette and drop it as a Master-Detail table-table construct in the Center facet of the PanelStretchLayout. Run the page.

In subsequent steps, surround the detail table with a PanelCollection, make its columns sortable. Then create a popup with a panelwindow that contains a databound form based on the Manager of the Department. Then add a showpopupbehavior to the DepartmentId to have the popup displayed when the department id is right clicked.

Next add a PanelAccordion, drag the EmployeesTable to its first detail item, add a second detail item and drag the EmployeeList from the Data Control palette, dropping it as a horizontal bar chart. Ensure both the Popup and this chart synchronize with the department table (set partialTriggers attribute) and run the application again.

Within 10 minutes.

JSF on Rails - JDeveloper 11g, ADF 11g and JHeadstart

Some remaining challenges

  • Even though a lot of drag & drop, still a lot of manual activity involved
  • Because of that, keeping the pages consistent – look & feel, structure, interactivity – can be a pain
  • Absorb/Apply global changes in either the Model or the layout and interaction structure and pattern is quite hard
  • Implementing common UI patterns – List of Values, Search Forms, Navigation, Breadcrumbs – can be made easier
  • The learning curve is quite steep – even though initially little programming is involved

Enter: JHeadstart

JHeadstart generates an ADF – JSF application from the model and a declarative definition of pages & data usages

For CRUD + + style applicationsor a headstart for process/task oriented applications

Many common data, interaction and layout-patterns are supported with out-of-the-box generation

  • Master-Detail(-Detail-….), Shuttle, List of Values
  • Form, Table, Tree, Overflow areas, File upload/download
  • Menu, Deeplink Navigation, Breadcrumb trail
  • Run-time management of Resource Bundles and Custom Items
  • Integrated Role based authorization for pages and items

Develop iteratively using JHeadstart

Preparation

  • Install JHeadstart extension for JDeveloper
  • Enable JHeadstart on Web application
  • Build (initial) business service with ADF BC
  • Create (default) Application Definition
  • Generate (initial) application: JSF pages, Page Flows, Managed Beans & Navigation rules, ADF Data Binding

Repeatedly, in iterations

  • Edit Application Definition
  • [Change Generator Templates]
  • [Modify Model (ADF BC Business Service)]
  • Regenerate

JSF on Rails - JDeveloper 11g, ADF 11g and JHeadstart 

JSF on Rails - JDeveloper 11g, ADF 11g and JHeadstart

Summary

  • ADF 11g helps create rich JavaServer Faces applications on top of EJB/JPA, WebService or ADF Business Components Business Services
  • ADF 11g Data Binding allow drag & drop style data binding of complex data driven components (form, table, tree, shuttle, many graph types, slider, pivot table, …)
  • ADF 11g Faces (Rich Client Components) provide rich layout components (popup, panelsplitter, accordion, tabs..)
  • JHeadstart 11g puts JSF/ADF ‘on rails’ with extreme productive no code generation of CRUD++ applications
     

 

Resources:

Download presentation slides: jsf_on_rails_jellema_devoxx2008