[Zope3-dev] ObjectHub notes: removing objects
Steve Alexander
steve@cat-box.net
Fri, 18 Oct 2002 15:34:04 +0000
> Hmmm... can someone explain why adding and deletion have been seperated
> from registering and unregistering?
They are different things.
When you add an object to a folder, you don't necessarily want to
register it with an object hub.
When you remove an object from a folder, it isn't necessarily registered
with an object hub, so unregistration is not necessarily necessary.
You will want to register an object with an objecthub at an arbtrary
point during its life. For example, when it reaches a certian point
during a workflow, or when it is moved to a particular place.
You will want to unregister an object with an object hub at an arbitrary
point during its life. For example, when it reaches a certain point
during a workflow, or when it is moved to a particular place.
> This seems unnecessarily complex to
> me so I must be missing something...
It is simple. You keep separate things separate, and carefully define
how they are related to each other.
>> Again, this is different from the case when an object is added, as the
>> object is not registered at the time it is added,
>
> Why not?
Because before an object is added, it has no location.
Registration requires a location.
Therefore, it must be added before it is registered.
>> Of course, adding an object to a container that is registered could
>> cause some sort of ObjectChanged event to be sent on behalf of the
>> container.
>
> Yeah, but relying on that feels brittle to me..
What, specifically, would you rely on it for?
--
Steve Alexander