Tuesday, February 7, 2012

Preparing to Work With ADF

So, you have started something in Oracle ADF without the safety of a tutorial. How do you even begin thinking about planning how to start developing? Welcome to this short five step program that will have you flying off the cliff in no time ;-)

Before You Even Start!
Move the properties window in JDeveloper! Did you see the nice categorized look of the object properties in the Quick Start Guide by Grant Ronald? If you want that look (and trust me, you do), move the properties window inside the bottom middle window.

One
I am a dinosaur. I enjoy reading books on real paper, so I buy those. I also like CTRL+F, so I get the electronic versions too. Anyway you do it, you have to have at least some essential books. They are important for more reasons than their actual technical content, they will help you realize just how much code you are going write. That is correct, you thought it was all declarations and xml files? Prepare to be amazed at the amount of "cheating" you have to resort to.

Three
Get your online resources ready. In my experience when you start developing, you will spend about half your time fiddling with JDeveloper, and the rest on various online sources. Prepare early by picking some winners:

Google.comHmm, yes, not really a big surprise. The thing is, Google has indexed a lot of pages, even some with ADF related content. To locate the good stuff, you have to be specific. Learn the lingo: vo, eo, am, etc. If you can, use method names or names of the standard classes (EntityImpl, ViewObjectImpl, ApplicationModuleImpl, etc). Also use faces component names ("af:outputText"), or names from the javascript api.

forums.oracle.comThis is where most of the technical stuff gets sorted out. It is a very active forum (and apparently Oracle product managers are spending some time there). I do not use Oracle's own search, but use a targeted Google search instead ("<your search term> site:forums.oracle.com").

As I said, you will spend a fair amount of time searching the net, and you have to beware what you find. Often old and outdated resources are ranked high in Google, and if you are on 11.1.2, clunky solutions from 10g is not really what you want.

Four

Get the source code! Supported Oracle ADF customers can request the source code from Oracle Support. It might not be the first natural thing to occur to you (it would, if you were a "proper" java developer), and at this stage in your "project" it is not first and foremost because of the debugging possibilities.

With the source code you are able to see parameter names (and not just types) in the code editor, Quick JavaDoc actually works, and "Go to Declaration" actually goes to a place with code in it.

+1 to ADF. When developing in Forms or APEX you are calling black boxes, in ADF you are actually able to see what happens.

Five

Depending on how advanced you intend your first sample application to be, you might want to have a look at two utility classes used extensively in the ADF community. They go by the names ADFUtils and JSFUtils. In a real project, you definitely want them! Nick Haralabidis also mentions them in his book.

You will frequently see them in sample code, but where do they actually live? If you download the official Oracle Fusion Order Demo Application, and look into the StoreFrontModule workspace, under the Application Sources of the StoreFrontUI project, you will be rewarded.