Interview with Javier Paniza on OpenXava 2.1
OpenXava, the rapid-web application framework, recently released version 2.1. InfoQ sat down with Javier Paniza, project lead for OpenXava to discuss the framework and the new release, which brings JPA support as well as many other enhancements.
OpenXava bills itself as a Ruby on Rails equivalent for Java EE applications. OpenXava builds applications by code generation based on XML. OpenXava is built to prefer definition (using XML) to programming (using Java). Business components are defined in XML, including validations, views, and ORM information, and then OpenXava generates the user interface to interact with the data. Paniza on what makes OpenXava unique from Seam or Trails:
The main difference between Seam and OpenXava is the abstraction level. The abstraction level of OpenXava is higher, in OpenXava you do not need to write the User Interface, and you get free a customizable list mode with ordering and searching capacities, pdf report generation, excel exporting, etc. As far as Trails, I’m a big fan of Trails and I think that we have the same underlying ideas, so there isn’t a big qualitative difference (maybe only the aesthetic issue of using XML instead of POJOs), rather the difference is quantitative. The generated user interface and behaviuor of OpenXava is richer, mainly because OpenXava has been in use since 2001 and has had the time to absorb the user feedback.
Paniza went on to describe how the Business Component Orientation of OpenXava changes how you develop an application.
Intestead of thinking in code (for business logic, data access, etc.) and dividing the work for your developers in that way, you think in terms of Business Components (Invoice, Customer, Delivery, etc.). OpenXava eliminates the need to write low-level code (UI or database access code) so you mainly write code for Invoice, for Customer, for Delivery.
But the best advantage is when you modify your code, if you want to modify something about the Invoice you only need to touch one place, the Invoice.xml component. Putting all information about a business concept in the same place has a lot of practical advantages.
The conversation then moved to what types of applications are a good fit for OpenXava.
Business database-backed applications, such as Invoicing, Accounting, Inventory, etc. In fact, OpenXava was born for re-writing applications originally hosted on an AS/400 and written using RPG. Any typical business application suitable for RPG, COBOL, 4GL, VisualBasic, etc. can be developed easily with OpenXava. If you want to develop a blog, a portal, a virtual shop, etc, then maybe using Spring or Seam (with a lower abstraction level) would be better.
Next Paniza described the architecture of OpenXava.
From an application developer perspective the architecture is:
- Business components: XML files that contain business logic, data structure, tabular data definition, views(UI) definitions and database mapping.
- Controllers: Groups of actions (in the GoF sense). The controllers define the behavior of the application. OpenXava has some useful default controllers for CRUD and Printing (for generating reports). But it’s common to develop new ones for custom applications.
- Application: A group of modules, where each module generates a portlet. The modules are the pieces with which the user can work. In the module the developer associates a business component with one or more controllers.
Behind the scenes:
- Code generator: For generating EJB2 code, POJOs, Hibernate mappings, portlet files, etc.
- User Interface: Currently a few JSPs and Servlets that generate the UI on the fly.
- Pluggable persistence provider: Currently we have EJB2 CMP, POJOs + Hibernate and POJOs + JPA persistence providers.
- Editors, validators, converters, stereotype definitions: For customizing the default behavior and extending OpenXava.
The next release of OpenXava will be version 3.0 and will have support for EJB3 Entities as well as some annotations as an alternative to XML. These options come as a result of feedback from users who want to use OpenXava in applications already using EJB3.