Oracle FAQ Your Portal to the Oracle Knowledge Grid

Home -> Community -> Usenet -> comp.databases.theory -> Re: Clean Object Class Design -- What is it?

Re: Clean Object Class Design -- What is it?

From: Craig Shearer <>
Date: Mon, 3 Sep 2001 10:40:38 +1200
Message-ID: <3b92b65d$>

"Bob Badour" <> wrote in message news:YtTj7.600$
> Craig Shearer wrote in message <3b8e9bff$>...
> >
> >"Sascha Bohnenkamp" <> wrote in message
> >
> >> > And
> >> > for bi-directional associations, it enforces referential integrity.
> >> which OODBMS does this and what is the kind of 'enforcement'?
> >> Is it only a setting of the bi-link to NULL or more?
> >> (rdbms forbid those actions or do a delete on cascade if you want them
> >> to)
> >
> >The ODBMS I use (JADE) does this. You define inverse relationships
> >reference properties (either singular references or collections) on
> classes.
> >When you define the inverse, you also define whether the relationship is
> >parent-child or peer-peer. In the case of a parent-child relationship, if
> >the parent object is deleted, then this will cascade delete the child
> >object. In the peer-peer case, deleting the object at one side of the
> >relationship will automatically update the other object's reference to it
> to
> >null.
> Who says it should even allow the delete in the first place? Are all
> references symmetric?

If you're asking about Integrity Checking, then there is no formal mechanism for defining this. However, it is possible to define code in the destructor for the class that would raise an exception under certain circumstances, thus preventing deletion by forcing the transaction to abort.

I'm not certain what you mean by symmetric references, but I'll hazard a guess. When references between classes are defined, you specify an update mode - effectively which side is manually maintained. So, if the relationship defines manual on one side and automatic on the other, then the compiler will reject (with a syntax error) code attempting to update the automatic side of the relationship. It is possible, though, to define both sides as manual/automatic, meaning that whichever side is maintained manually, the other side will be automatically maintained.

Craig. Received on Sun Sep 02 2001 - 17:40:38 CDT

Original text of this message