| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: circular relationships ok?
Volker Hetzer schrieb:
> Alexandr Savinov schrieb:
>>> Alexandr Savinov schrieb:
>>>> A model with cycles is not a concept-oriented model (theoretically).
>>>> It is a strong constraint but it is part of the definition. Then the
>>>> question is if it is useful or not. For any model there are examples
>>>> which are non-trivial and very difficult to implement. Loops and
>>>> cycles can be always avoided by introducing a common subconcept. If
>>>> A and B mutual reference each other then we introduce a common
>>>> subconcept C:
>>>>
>>>> A B
>>>> \ /
>>>> C
>>>
>>> Ok, here goes:
>>>
>>> Net<-------\
>>> | |
>>> V |
>>> Constraint*|
>>> | |
>>> V |
>>> Token* |
>>> / \ |
>>> | -----/
>>> V
>>> Constant
>>>
>>> (* denotes "zero or more")
>>> ("Token" refers to either a constant or a Net, not both.)
>>>
>>> How would you do it?
>>> Maybe I'm blind but I simply don't see it.
>>> My problem is that the relations are directed. A Nrt doesn't
>>> refer to constraints and tokens, a net refers to constraints
>>> and the token optionally refers to another net.
>>> Even if I add a Token/Net table, I still have the circle.
>>
>>
So net does not reference any other item.
> A constraint always needs a net, it doesn't need tokens.
So constraint item will reference (know) a net. It will not reference a token.
> A token needs a constraint, and it needs either a net or a constant.
So a token references constraint. For OR you might define two fields, it is a separate problem in data modeling.
> The tricky bit is deleting a net. If that net is referenced by other > tokens, the delete ought to fail.
No, in good model it should be managed automatically. If you delete a collection then all its elements have to be also deleted (we treat a referenced item as a collection). In the concept-oriented model the deletion is propagated automatically down till the bottom. However, the deletion is not necessary a physical deletion. It is more general. When you delete a data item, say a net object, then you actually say that it does not exist anymore as an entity. The non-existence then is expressed as physical deletion of this item. However, for all its subitems (items that reference this item) we do not use physical deletion but rather we set this reference to null. Since null is equivalent to non-existence (in COM) then it is quite correct operation. So a token that referenced the deleted net will have null instead of it automatically. However, each concept where data items live should define if null is permitted, i.e., if this item can exist with null in some position. If not then this item is automatically deleted and, as a consequence, its subitems are assigned null value in the corresponding field. This operation is then propagated down to the bottom.
By the way, the deletion can propagate also upward and in this case it is based on reference counting. If some item is referenced less than N times (by its subitems) then it can be automatically deleted. If N=0 then it is precisely garbage collection mechanism. Items which are not referenced are deleted.
> I need to think that over. > >>
>>
>>
>> > > Thanks a lot! > Volker
http://conceptoriented.com Received on Thu Mar 02 2006 - 14:54:19 CST
![]() |
![]() |