IReferencesCascadeDelete
PstrfIReferencesCascadeDelete` interface enables cascading deletion of objects (the object all the referencing object is also deleted).
How does IReferencesCascadeDelete
The logic for cascading delete is spelled out in business server interface IReferencesCascadeDelete
, own properties and methods this interface does not provide. Thus, together with some object to remove all objects that refer to it, enough that the object class was inherited from IReferencesCascadeDelete
.
The classes that refer to the desired, as follows:
- Defines the directory where is the Assembly with the class, to which we are looking for.
- In the directory are selected, all assemblies whose name ends with «(Objects).dll».
- In assemblies looking for types that inherit from DataObject.
- In the found types are defined by properties that contain a reference to the desired class or its ancestors.
Example
Suppose we have a diagram of the form:
On the chart attached IReferencesCascadeDelete
with the stereotype externalinterface , from which inherited class Territory2
and Country2
. When you delete instances of this class will be deleted also all the objects that refer to them.
At the specified location of classes subject to the inheritance:
- When you delete a class instance
Territory2
will examine the links among instances of classesHuman2
andPlace2
. - When you delete a class instance
Country2
will examine the links among instances of classesHuman2
,Place2
,Adress2
,Apparatus2
(instances of the classRegion
are detaylari and will be removed even without using its interface).