Skip to main content

No Inbetween

Posted by editor on October 25, 2005 at 8:59 AM PDT

Think entity beans don't support inheritance? Think again.

Sometimes authors have to sell a skeptical editor on the concept of an article. This is the case with an article today, which shows how to achieve inheritance with EJB entity beans. My first reaction as an editor was "Is this such a big deal? If inheritance is a big deal to you, can't you just use a POJO-based framework?"

The key, in the case of today's Feature Article, is that this fundamentally misunderstands the question. Maybe an entity bean, understood as an object, doesn't support inheritance, but who's talking about objects? In Component Inheritance in EJB 2.0 re-frames the question around the concept of a component:

A component is a typed, deployable unit of functionality that adheres to a contract of specified interfaces and deployment rules with a component model framework. A component has no observable state despite any instances or data it may create. Further, a component such as an entity bean is not simply its interfaces, EntityBean class, and descriptor files, but also any objects, code, or other resources created by the container in its deployment.

From this, you can open your mind enough to get to the point where inheritance works:

Component inheritance can be confusing and difficult to grasp for OOP developers due to choices in implementation and demarcation. Some implementations, such as ours, rely in part on object inheritance. Other choices might use delegation, proxies, or other devices that may not fit the object-oriented inheritance definition. The hierarchy mapping is also specified in a less overt manner. In Java's object inheritance, the relationship is clearly marked by the key word extends. Component inheritance might be declared in an XML file, as a metadata key, or via some other manner--it may not be evident in the code at all.

The article goes on to explain why you would want component inheritance and, finally, how to achieve it in EJB 2.0

Swing documentation, communication, and plain weirdness are up for review in today's Weblogs, in which Alexander Potochkin relates The story of one "not a bug":
"Recently I came across one interesting bug 4413412 which seems to discover very odd Swing behaviors and really looks like a bug. Anyway after a little investigation I closed it as not a defect."

Kohsuke Kawaguchi creates a
Hangman game by using Dalma:
"Dalma is a workflow engine that lets you write conversational programs quickly. Today, I added a little hangman game as a sample to Dalma."

18 years of toil, a lot of help from the compiler, and a small but rare personal distinction, Satya Komatineni relates
"How in 18 years the code I wrote ran the first time."

In Also in
Java Today
the O'Reilly Network Databases site points out Andrew Gilfrin's blog entry A MySQL Mantra in which he passes along some sage wisdom about working with Oracle -- try to use a single line of SQL, then try as little PLSQL as possible, then try Java, etc. -- and adapts this line of thinking to MySQL.

"The paper 'A First-Class Approach to Genericity' introduces the idea of the mixin, which seems to be quite a powerful concept, and then shows that you can't do it with Java generics." In Mixins: Something Else You Can't Do With Java Generics?, Bruce Eckel (author of Thinking in Java ) asks "I wonder if anyone has any alternative approaches to this problem."

In Projects and
the blueprints project now has an extensive AJAX FAQ for the Java Developer. This J2EE-oriented FAQ covers available AJAX libraries, discusses issues with security, usability, and internationalization, and covers advanced issues like concurrency, saving state, sending images, and polling.

In the article JAXP validation, Java and XML author Brett McLaughlin looks at the improvements made to the Java API for XML Parsing (JAXP) in J2SE 5.0, including validation support, support for XML schema and RELAX NG, and more. "All of these improvements finally give Java developers an industrial-strength solution for XML validation."

In today's Forums,
neutel offers up an
XMPP Resource Adaptor for Mobicents:
"I've just added to CVS one initial version of a XMPP Resource Adaptor. In this version two types of connections are supported, client-server and component-server. To implement the component-server connection the smack library had to be changed, so, it is very important to replace the smack library in mobicents/lib for the one in ra/xmppra/lib. Comments and suggestions are welcomed."

grantsmith continues to track Mustang breakage in
Re: Recent builds: problem with Intellij IDEA:
"Build 57 still fails. It's been two builds since the rollback was planned. Any clue as to when it will be implemented?"

In today's
News Headlines

Registered users can submit news items for the href=""> News Page using our
news submission
. All submissions go through an editorial review before being
posted to the site. You can also subscribe to the href=""> News RSS

Current and upcoming Java

Registered users can submit event listings for the href=""> Events Page using our href=""> events submission form.
All submissions go through an editorial review before being posted to the

Archives and Subscriptions: This blog is delivered weekdays as
the Java
Today RSS feed
. Also, once this page is no longer featured as the
front page of it will be
archived along with other past issues in the href=""> Archive.

Think entity beans don't support inheritance? Think again.