It seems to me that sometimes the difference is a bit blurry.
I used to consider announcements like some kinds of user-generated events,
but I may be wrong here :/

I'll use SDL as an example because this is the technology chosen for Pharo.
In SDL the concept of announcement does not exist. However, you can use
SDL_PushEvent to push any event into the event queue.

So if you manually push some mouse events, you'll have the events coming
directly from the hardware and the ones you have pushed but both will be
handled the same way.
In this case, should user-generated events be considered as announcements
and hardware-generated ones be considered as events ? Or are all these
events just events ?

In SDL, there is also another kind of event : SDL_UserEvent which is a
custom event in which the user can put any data and then push it into the
queue.
I feel like this one is really close to be considered as an announcement
but it is still handled like any other event.

Basically in these cases, which ones are real events ? and which ones are
announcements-like events ?


An event is managed by the event loop and other. The idea is that other
> objects do not register to an event.
>         it happens to me.
>
>     An announcement is raised and unknown object can register and get
> access to it.
>         Other register to react to it.
>


If an announcement is raised, you need to register to it to be able to
react. Okay.
But is it not the same thing for events ? If an event is raised you still
need to somehow register to it to be able to react.
In SDL, if you don't choose to handle the event in your switch then you
won't be able to react.
In OSWindow, if you don't choose to implement the "visitWhateverEvent:"
method, then you won't be able to react.

That's why for me, an announcement is like an event, except an event is
raised by the hardware and you don't really have a choice about what it is
made of, whereas an announcement is raised by the user and he can do
whatever he wants with its definition.



2015-07-28 9:58 GMT+02:00 stepharo <steph...@free.fr>:

> I think that in Bloc alain did it on purpose and not just by accident.
> Alain may correct me:
>
>     An event is managed by the event loop and other. The idea is that
> other objects do not register to an event.
>         it happens to me.
>
>     An announcement is raised and unknown object can register and get
> access to it.
>         Other register to react to it.
>
> So Event is not equal to Announcement
>
> Stef
>
>
>
> Le 27/7/15 23:57, Peter Uhnák a écrit :
>
>  Hi,
>>
>> is there a good reason why not just rename Announcement to Event since
>> everyone is calling it that anyways?
>> Everybody (almost irrespective of language) understands what an event,
>> whilst Announcement is a new vocabulary.
>>
>> Most people when subclassing will anyways do
>>
>> Announcement subclass: MyEvent
>>
>> and so forth.
>>
>> Is there a benefit in naming it Announcement? Doesn't it just add more
>> confusion?
>>
>> For example Bloc has
>> Announcement subclass: #BlAbstractEvent
>> and
>> Announcement subclass: #BlMorphAnnouncement
>>
>> whilst Event is clearly favored.
>> BlMorphAnnouncement allSubclasses size. "5"
>> BlAbstractEvent allSubclasses size. "60"
>>
>> (Why does Bloc has this separation anyways?)
>>
>> Peter
>>
>
>
>

Reply via email to