Productivity, choice and ADF metadata

As you may have read in Wilfred’s post: new weblog of it-eye, i’ve been working on a disconnected ADF Swing client. Users will enter data on a laptop, without having network connection. When they need to send data they can create a network connection using a UMTS card, and the information will be sent to a web service. I thought it might be interesting to explain how we’re using ADF in this project. Oracle has been positioning jdeveloper with the following slogan: productivity with choice. Choice meaning that you can decide yourself which technologies you are going to use on your project. Most productivity tools will force you into some technology stack, but ADF allows you to choose which technologies you want to use. The ADF bindings will just tie these technologies together.

Is this for real? Or is it just marketing speaking?

Let’s start with a picture. I used the following picture in a presentation 2 weeks ago. It shows you a part of our client application. In fact, it displays the ADF metadata required for connecting a piece of the Swing client to the model and to a web service. The orange boxes represent xml files containing ADF metadata.

ADF

The right part is the gui project. It consists of a great number of panels for data entry. Databindings.cpx is a xml file which lists all the uimodels in the project. JDeveloper creates one uimodel file per panel. This xml file describes all the ui components on the panel and what data from the datacontrols they use.

On the left side you see some data sources. Left bottom is a piece of the domain model, the data the user enters and which will be saved in a xml document. We use castor to save and load the data. We’ve defined a xml schema which defines the datamodel, then used castor to generate java code. A hand coded service facade (ClientModelService) sits in front of the domain model. Using Jdeveloper you can generate ADF metadata for the domain model and the service facade by selecting the ‘generate data source’ command. So here we use ADF to access POJO’s generated using castor.

Top left is the web service stub. You can generate the web service client stub using a wizard in jdeveloper and then you specify that the stub is an ADF datasource.

Once you have these datasources you can drag and drop the data and the functions on the Swing panels. For example, you can drop a web service call onto a panel as a button or a class attribute as a field. We also have a web interface which is created using jsp’s and adf business components.

So, as you can see, we have been using adf with a number of view technologies (swing, jsp) and a number of model technologies (web services, castor xml, and business components). The choice promissed is not just marketing speak.

Ofcourse we’ve found some bugs, issues and inflexibilities. For example, if you want to create a jtable based on an adf datacontrol it can only have a fixed number of columns. We also noticed that Castor is a better fit for ADF than other xml frameworks like JAXB.

I feel that ADF, very much like JSF for example, is a tool enabling technology. It enables Oracle to put a lot of productivy tools (wizards, visual editors, drag and drop, property editors) in jdeveloper. But without these tools adf is not a productivity boost. So if you are a programmer who likes to create applications mainly by coding, adf is not for you. Just look at the number of xml files you need to maintain. And you will not be able to use code completion in a meaningfull way, as everything is called dynamically through the adf api’s. A framework like Spring will probably be better for coders. But if you’re a 4gl developer looking to make the switch to java…

blog comments powered by Disqus