Igor Stasenko wrote:
> 2009/10/28 Stéphane Ducasse <[email protected]>:
>   
>
> well, my initial idea is to enable a package developer to establish own policy
> for his package.
> A policy get notified of any change before it made and of course
> doesn't cares if there's anyone
> who listens for notifications of changes, after they applied.
> The open question, is how to allow developer to not only use
> predefined set of flags for policy,
> but also introduce own custom rules. For example, one might want check
> the submitted method against lint rules,
>  and prevent method from being installed if rules not satisfied :)
>
>   
You defined a set of announcement classes, each one is for a particular 
kind of event.
So, no need for #changeKind and #parameters dictionary instance variable 
(please no!).
The action which is applied is simply implemented by the announce sender.

Before a system event occurs, an announce is sent saying that the event 
is about to occur.
Then declared listeners could decide if the event can really occur
(if a listener is in a state which forbid the event then it can change 
the announce which was sent).
If the sent announce is not change (recall that this is an object), then 
it means that a consensus about
the feasibility of the event is obtained.
Then the particular event can occur.
After, an announce indicating that the event has occurred is sent.
I'm not sure but I think that seaside is already using announcements 
with such kind of consensus protocol.

Alain

_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to