667481 members! Sign up to stay informed.

Sponsored Links


Resources

Enterprise Java
Research Library

Get Java white papers, product information, case studies and webcasts

News News News Messages: 4 Messages: 4 Messages: 4 Printer friendly Printer friendly Printer friendly Post reply Post reply Post reply XML XML XML

OpenXava 3.1.2: AJAX applications from JPA entities

Posted by: Javier Paniza on April 24, 2009 DIGG
OpenXava 3.1.2, released recently, is a model-driven framework to develop Java Enterprise applications in an agile way: With OpenXava you provide only your POJOs annotated with JPA and you obtain an AJAX application ready for production.

The main new feature of this 3.1.2 release is the support for view inheritance. Although OpenXava generates a workable user interface from your naked JPA entities, you have the option to refine the produced user interface using the @View annotation. Just in this way:

@Entity
@View(name="WithSections",
members =
"name, sex;" +
"mainLanguage;" +
"experiences { experiences }"
)
public class Programmer {

Since version 3.1.2 you can defined a view extending an existing one. For example, you can reuse the WithSections view in a child class of Programmer:

@Entity
@View(name="WithSections", extendsView="super.WithSections",
members =
"favouriteFramework;" +
"frameworks { frameworks }"
)
public class JavaProgrammer extends Programmer {

As you can see, the way to extends a view of the superclass is using the super prefix for extendsView. In this case the WithSections view of the JavaProgrammer entity will have all the members of the WithSections view of Programmer entity plus its own ones.
Look the aspect of WithSections view of JavaProgrammer.

You can learn more about this new feature in the OX wiki.

Moreover, OpenXava 3.1.2 has a lot of new features and fixes, including the translation of the reference guide to Russian, and the new @OnSelectElementAction annotation for collections.

What do you think about generating the full application from JPA entities?
Do you like the @View annotation?
What do you think about the 'view inheritance' new feature?

More info: http://www.openxava.org/

Threaded replies

·  OpenXava 3.1.2: AJAX applications from JPA entities by Javier Paniza on Fri Apr 24 08:50:24 EDT 2009
  ·  Re: OpenXava 3.1.2: AJAX applications from JPA entities by Casual Visitor on Fri Apr 24 15:40:26 EDT 2009
    ·  annotations seem natural for remoting by Jason Trump on Fri Apr 24 16:44:48 EDT 2009
      ·  Re: annotations seem natural for remoting by Javier Paniza on Mon Apr 27 04:40:00 EDT 2009
    ·  Re: OpenXava 3.1.2: AJAX applications from JPA entities by Javier Paniza on Mon Apr 27 04:19:52 EDT 2009
  Message #307895 Post reply Post reply Post reply Go to top Go to top Go to top

Re: OpenXava 3.1.2: AJAX applications from JPA entities

Posted by: Casual Visitor on April 24, 2009 in response to Message #307835
This is the best description of OpenXava I could find on the OpenXava site: http://today.java.net/pub/a/today/2008/06/24/automatic-user-interface-with-openxava.html . It's amazing to me how difficult many projects make it for the interested to get a meaningful overview in a reasonable time frame.
Annotation-based, 'automatic' RAD-Web-interfaces seem to be the current trend. I wonder how far you can go with annotation-base programming, which and how many annotations make sense.

  Message #307897 Post reply Post reply Post reply Go to top Go to top Go to top

annotations seem natural for remoting

Posted by: Jason Trump on April 24, 2009 in response to Message #307895
which is at least part of what openxava is doing. i like the idea of using annotations to mask out a "remote interface" on your classes for ajax calls. seems like there's some similar architectural ideas in Adobe Flex, put to good use.

generating the entire view from the model, on the other hand, might be losing sight of why we separate presentation from data in the first place. seems like it could create some pressure to structure the model to suit a specific view, which would then create a barrier to later abstraction as your application grows.

i'd also be interested to know how you can express workflow concepts in OpenXava. For example, views personalized to a user's role.

of course, these are pretty abstract concerns and maybe there are obvious answers. openxava looks like a really interesting idea.

  Message #307956 Post reply Post reply Post reply Go to top Go to top Go to top

Re: OpenXava 3.1.2: AJAX applications from JPA entities

Posted by: Javier Paniza on April 27, 2009 in response to Message #307895
I wonder how far you can go with annotation-base programming, which and how many annotations make sense.


The question is not about annotations, but about Business Component concept.

The first point is to put all the stuff about the same business concept in the same place, thus when the developer has to change the structure and business logic he need to touch a reduced number of files (one for business concept).

The second point is to generate automatically all the possible stuff, in this way, the business component (a Java class in OX case) has more declarations and less programming.

An example of the above idea is JPA. With JPA you put inside your entity info about database access, but it's a declarative info, the real database access is done automatically by the JPA engine. You have two advantage, you only have to touch one file (the JPA entity) for change structure (you do not need to touch external XMLs, or rewrite DAO objects), and you do not need to write database access code.

OpenXava extends this idea to user interface.
This is very practical if you changes your model frequently. In OpenXava for adding a new property to an entity, just add the property to the entity, run the application and see the change. You touch only one file.

How many files do you need to touch to do the same with your favourite framework?

  Message #307957 Post reply Post reply Post reply Go to top Go to top Go to top

Re: annotations seem natural for remoting

Posted by: Javier Paniza on April 27, 2009 in response to Message #307897
might be losing sight of why we separate presentation from data in the first place.

With OpenXava annotation you define you preferred way to display your objects in an abstract way, but it does not contain any implementation detail about user interface, it's just abstract.
It's the user interface generator that interpret it creating a suitable user interface.
By now, OX generates AJAX application that can run inside a Java portal, but other UI generatos, such as JavaFX, FLEX or Mobile devices, can be developed. So, your application would have another user interface without touching a single line of your source code.


seems like it could create some pressure to structure the model to suit a specific view, which would then create a barrier to later abstraction as your application grows.

You can define several views for the same entity.
Moreover, you always have the option of creating a handmade view.


i'd also be
interested to know how you can express workflow concepts in OpenXava. For example, views personalized to a user's role.

For this case, a common solution is to define a view for each user role, and generate a module (a module produces a portlet) for each view. Then, using the portal security, the administrator can assign the modules to the roles, groups, etc.

New content on TheServerSide.comNew content on TheServerSide.comNew content on TheServerSide.com

Dependency Injection in Java EE 6 - Part 1

Reza Rahman explores the features of the proposed JSR 299, Contexts and Dependency Injection for Java EE (CDI). When approved, it promises to be a key feature of Java EE 6. (November 2, Article)

SAML: It's Not just for Web services

SAML is an XML-based standard for exchanging authentication and authorization data between security domains. The single most important problem that SAML was created to solve is the Web browser Single Sign-On problem. Many organizations are debating whether to stay with version 1.1 or move to 2.0. This article makes observations about both options. (September 28, Article)

Programming is Also Teaching Your Team

Joe Ottinger takes a look at how people learn, and applies it to the practice of programming. He notes that understanding how people learn is an essential part of working in a programming team. (September 22, Article)

Can Java EE Deliver The Asynchronous Web?

Stephen Maryka gave us an article about the Asynchronous Web and posed a number of questions that get examined like an approach to delivering Asynchronous Web capabilities through extensions to existing Java EE technologies. (July 14, Article)

JSF Flex

JavaServer Faces Flex goal is to provide users capability in creating standard Flex components, part of flexSDK which is open sourced through MPL license, as normal JSF components. This article by Ji Hoon Kim will provide an overview of creating a simple multilingual JSF page consisting of JSF Flex tags. (June 29, Article)

The Rules of SOA - A Road to a Successful SOA Implementation

In this session Jeff explores the key characteristics of successful SOA projects. He covers some of the patterns, and anti-patterns, tool sets, and strategies that he himself learned the hard way. Last, he provides a strategy and blueprint for achieving a high likelihood of success in your SOA project. (June 23, Tech Talk)

Ari Zilka Talks About Terracotta 3.1

Ari Zilka, CTO of Terracotta, Inc., talks about the new features in Terracotta 3.1, announced during JavaOne and available now. (June 15, Tech Talk)

Enterprise Application Integration, and Spring

In this Tech Talk, Josh Long explores an integration challenge using Spring Integration and walks through the implementation, employing and expanding on the basic patterns of Enterprise Application Integration to tie together components into a function integration solution, and then demonstrates how Spring Integration helps address the integration requirements. (June 15, Tech Talk)

Google Web Toolkit: An Introduction

In this Tech Talk, David Geary teaches you: The basics of Google Web Toolkit; How to implement Ajax-enabled applications in Java; Internationalization; Hooking into the browser history mechanism; Remote procedure calls. (June 4, Tech Talk)

Just Enough Early Architecture to Guide Development

Jon Kern discusses the best architecture/technical solutions and ensure that they are repeated by all developers. By tackling the architecture up-front in a serial manner, subsequent parallel development will be much more manageable and predictable. (May 28, Tech Talk)

Productive Programmer: On the Lam from the Furniture Police

This keynote describes the frustrations of modern knowledge workers in their quest to actually get some work done, and solutions for how to guard yourself against all those distractions. Neal Ford talks about environments, coding, acceleration, automation, and avoiding repetition as ways to defeat the misguided attempts to sap your ability to produce good work. (May 26, Tech Talk)

Auto-Scaling Your Existing Web Application

Gil demonstrates how new, aggressive uses of already abundant compute capacity by common applications offer competitive value for application designers. (May 21, Tech Talk)

Automating Hibernate Mapping and Queries For Java Web Development

Chris Keene introduces WaveMaker as a new way to automate the ability to generate Hibernate classes in order to more quickly bring OR mapping into an application. (May 19, Article)

Auto-Scaling Your Existing Web Application

In this session Nati Shalom demonstrates how to take a standard Java EE web application and scale it out or down dynamically without changes to the application code. Seeing as most web applications are over-provisioned to meet infrequent peak loads, this is a dramatic change because it enables growing your application as needed, when needed, without paying for unutilized resources. (May 19, Tech Talk)

Free Book: Jakarta-Struts Live

Download the entire book of Jakarta-Struts Live and learn about Struts MVC, Tiles, the Validator, DynaActionForms, plug-ins, internationalization, and more.
(Book PDF Download)

Application Server Matrix

The Application Server Matrix is a detailed listing of J2EE vendors and their application server products, with information on latest version numbers, J2EE spec support and licensing, pricing, platform support, and links to product downloads and reviews.
(Application Server Comparison Matrix)

News | Blogs | Discussions | Tech talks | Patterns | Reviews | White Papers | Downloads | Articles | Media kit | About
Java Solutions
All Content Copyright ©2007 TheServerSide Privacy Policy
Site Map