Dive into Oracle ADF

Send me a mail
 Dive into Oracle ADF   Click to see the XML version of this web page.   (Updated: 2/3/2008; 8:11:44 PM.)
Tips and tricks from Steve Muench on Oracle ADF Framework and JDeveloper IDE

Search blog with Google:
 

Search BC4J JavaDoc:
 

January 2003
Sun Mon Tue Wed Thu Fri Sat
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  
Dec   Feb

Get Firefox!

Thursday, January 16, 2003

Our JDeveloper/JUnit integration is provided through an optional, additional download so many JDeveloper/BC4J users probably haven't tried it yet. In my recent work to build a best practices BC4J/Struts reimplementation of the Java Pet Store Demo, I found it incredibly useful as I refactored my application several times, each time improving the package structure for learnability. Here's how to get JUnit integration setup in JDeveloper.


11:24:18 PM    



Users are starting to do sophisticated things with the BC4J framework as evidenced by their questions in the OTN forum. This week, two different (1, 2) threads on the OTN discussion forum have asked for the ability to include customized framework base class methods on the portable remote interfaces that BC4J offers. They want to, say, extend oracle.jbo.server.ViewObjectImpl into com.theircompany.bc4j.OurViewObjectImpl and then create a com.theircompany.bc4j.OurViewObject interface that exposes some of their additional custom functionality in a global, portable way across tiers. We're tracking this feature request as Bug#2243811. The reason it's not just immediately possible is that, when you do a physical three-tier deployment, BC4J generates you remote implementation classes that implement your custom interfaces. We currently don't have a way to do this other than by directly creating a full-fledged ViewObject or ApplicationModule component, and then publishing methods on that.

In the forum, Rob Hasselbaum suggests an idea that exploits the currently working functionality as a workaround for what he wants to accomplish: create a real "base" view object with both an XML descriptor and Java implementation file and use that as the base to extend from, instead of just subclassing ViewObjectImpl without the XML part.

I'll give it a try and report back...


6:08:53 PM    


Did you know about the built-in BC4J code template to make writing test client programs quicker? I write a lot of BC4J test programs while helping answer questions about the framework, so I got the developers to build-in the following code template: bc4jclient

For an example of using this code template, try the following:

  • Select New Class... on the right-mouse menu for you project and finish the wizard to create a new skeleton class
  • Put the cursor in a spot in the file where it would be syntactically correct to add a new method, and type main followed by [Ctrl]-[Enter]
  • Then, with the cursor automatically placed for you inside the newly added main() method, type bc4jclient followed by [Ctrl]-[Enter]

You can define your own code templates to make quick work of any frequently-done typing by going to Tools | Preferences... and selecting the "Code Templates" subcategory (inside the "Code Editor" category).


1:38:51 PM    


<rant>
The OTN discussion forum team upgraded the software that the forum runs on in December. In doing so, they added a long-awaited performance boost to the system, but introduced a few annoying issues that still haven't been resolved. I'm sending an email today to the VP of OTN at Oracle raising the visibility of these problems. Up until now, I've been emailing the developers and it's just taking too long to get resolved for my taste. Since I "work" the forums all day long, perhaps it's more frustrating to me than others.
</rant>

Letter sent.


11:55:26 AM    


Today over in the JDeveloper discussion forum on the Oracle Technology Network, some advanced BC4J framework users are asking about a feature enhancement to allow BC4J view objects to be based on other views.

In fact, if we allow an entity object to be based on a view object, this would enable quite sophisticated multi-table mapping capabilities without adding any new concepts to the framework. We've definitely thought of this in the past, but have only begun to see user demand for the idea in the last few months. To be honest, in late 1997 when we demonstrated the first alpha version of the BC4J framework to Larry Ellison, one of his first questions during the demo and overview was, "Can view objects be based on other view objects?" So, the idea has definitely been on our radar since the beginning.

Entity objects and View Object rows were designed to have a lot in common (e.g. oracle.jbo.server.Entity extends oracle.jbo.Row). It's the roles they play in the different application layers that are different.

View objects define an arbitrary SQL query and produce rowsets. The view object holds the metadata about the structure of those view rows, and how attributes in the client-accessible view row "value objects" relate to zero or more related entity object "usages". The view object manages collections of view rows called RowSets.

Entity objects are business object instances with validation and business logic, having a row-like attribute storage structure. The "entity definition" object (oracle.jbo.server.EntityDefImpl) holds the metadata about the structure of those view rows, and how attributes in the middle-tier-only-accessible business object map to database table columns (if any). The entity definition object plays the role of a factory/home for entity instances and manages a collection of entity instances in an entity collection (cache).

While the view object uses its arbitrary SQL query to find zero or more view rows, the entity definition object looks up an entity instance exclusively by primary key.

You can use view objects and their arbitrary SQL queries to expose custom entity-object-level "finders", as well. On the view link "View Link Properties" panel, there are checkboxes that control whether accessor methods are exposed at the view object level and/or the entity object level.


10:21:58 AM    


Another common question I get alot is, "I'm trying to do .... and I get oracle.jbo.DMLException. Why is this happening?"

When something doesn't appear to be working in your BC4J-based J2EE application, there are a couple of simple ways to get more information...


9:22:13 AM    


© Copyright 2008 Steve Muench.