Hi again,

On 31/05/2007, at 4:32 PM, Craig L Russell wrote:

On May 30, 2007, at 11:19 PM, Lachlan Deck wrote:

On 31/05/2007, at 4:13 PM, Craig L Russell wrote:

On May 30, 2007, at 8:19 PM, Lachlan Deck wrote:

However, my question remains this: if not defined in a relationship where does the developer define the delete rules etc? Or are you suggesting they don't get an option?

In an inheritance situation, there is only one instance corresponding to the rows (one row in each table in the hierarchy). I'm suggesting that there is no option. If the instance is deleted, then the row in each table is deleted.

That's fine when the parent is abstract (i.e., not instantiatable). What about when the parent is not abstract and where it is thus possible to simply fetch/instantiate the parent entity on its own. What happens when the user deletes the parent object in such a situation? Should I not get the choice?

I don't believe that you should be able to fetch the parent entity on its own. IMHO If you allow the parent entity to be fetched and don't also fetch the data from the subclass then you have a broken mapping. The user should not be allowed to get a partial instance (data from the parent table only) because then the whole Java concept of subclasses overriding behavior doesn't work any more.

There are numerous uses for these partial instances (if you'd like to call them that) when you want to only fetch the characteristics of the parent, for example, without also having to fault in the data for the subclasses. e.g., if I have a service thread that once every 10 minutes or so polls a message-queue to send a message to a list of recipients the only data I'm interested in fetching in is that of the parent entity.

This is not breaking any inheritance rules even in Java as I see it. It is after all possible in Java itself to have a non-abstract superclass. Whether this leads to a broken mapping or otherwise I don't believe should be a restriction enforced by the tool... but certainly you might like to document the advantages/disadvantages of such an approach.

If it's of any help these concepts have been around for a while (http://developer.apple.com/documentation/WebObjects/UsingEOModeler/ index.html).

with regards,
--

Lachlan Deck



Reply via email to