Hi Peter!
I do not have the time go through your post in detail. But perhaps this
is part of an answer:

It you use inheritance in EJB (it works !) then you run into a problem
with the lookups (finders). Lets say you have a collection of insects
consisting of bees and wasps (bee and wasp iherit from insect). If you
only have the PrimaryKey of a single insect object you are not able to
use the InsectHome.findByPrimaryKey since it looks in the wrong table !
You already have to know if you are looking for a bee or a wasp and use
BeeHome.findByPK od WaspHome.findByPK. The situation is different if you
still have the "real" object, meaning the remote interface. Also storing
the handles instead of the PK might help in this situation.
We tried to "solve" this by also storing the final type of the object
with the PK. Looks ugly in the code, lots of "if"s !

Did that answer part of your question ?

Cheers,
Tobias

Peter Routtier-Wone wrote:
> 
> > I also fail to understand why it is a problem.  How is recursive
> references
> > different to any other entity relationship?  Just store a PK, a Handle,
> > whatever...
> 
> In a schema I have a Category table related m:m to itself via a Subcategory
> table, allowing the recursive construction of taxonomies of indeterminate
> depth. This is the self-referential part (what I called a recursive
> structure).
> 
> There is also a Thing table, and a ThingCategory table that allows things to
> be assigned any number of classifications.
> 
> It is possible for categories to apply to a thing indirectly by implication
> of what might be described as taxonomic inheritance. (In fact the taxonomy
> is potentially a network rather than an hierarchy, so there can be multiple
> inheritance, but that is another matter.)
> 
> Now an example of what's been bamboozling me.
> 
> Suppose the taxonomy were of species; Butterfly would be a subclass of
> Insect, which in turn subclasses Animal, likewise Organic. Consider a
> particular butterfly called Jim, represented by a row in the Thing table.
> 
> We assert that Jim is a butterfly by creating a suitable row in the
> ThingCategory table. However, because Butterfly is a subcategory of Insect
> (etc), by implication Jim is a member of the classes insect, animal and
> organic. Inheritance.
> 
> Certainly it is possible to materialise the categories that apply by
> implication to Jim (or any other thing) but I am somewhat at a loss to say
> how one might (efficiently) go about retrieving a set of Things that are
> members of the category Animal.
> 
> The problem, as I see it, is primarily one of inability on my part to
> express the above ideas in EJB terms. It is with the semantics of the model
> that I most want help. On re-reading the EJB tome currently ballasting my
> desk, I now suspect that this will be done with finder methods. I am in the
> process of coding a utility class that does the recursive expansion of
> categories given a starting category, in order to succinctly express the
> finder method.
> 
> --
> --------------------------------------------------------------
> To subscribe:        [EMAIL PROTECTED]
> To unsubscribe:      [EMAIL PROTECTED]
> List Help?:          [EMAIL PROTECTED]


--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
List Help?:          [EMAIL PROTECTED]

Reply via email to