jamoma / jamoma2

A header-only C++ library for building dynamic and reflexive systems with an emphasis on audio and media.
MIT License
30 stars 6 forks source link

Rename Notification and Message classes. #75

Open nwolek opened 8 years ago

nwolek commented 8 years ago

I found this note in the comments here:

An Event in Jamoma may be one of three types:
        - Message
        - Parameter
        - Notification

If notification is a description of an Event, it is the thing being passed and not the actor. Therefore, it would make more sense to keep the term Notification in place.

Doing a bit of google searching revealed that almost no one refers to the class as Notifier. Instead this seems related to GoF 293 Observer pattern, where this is the name of the actor and the Notification is the thing being passed from the Subject.

tap commented 8 years ago

A Notification is an event, yes. But the emitter of the notification is not an event. Thus the desire to call it the Notifier.

I believe in our conversation we got that part right. It is also still consistent with my reading of the GoF Observer text. What we need to review then is the naming of the others.

A Message is an event. So the "port" or "socket" in our object that accepts those messages should not be called message. Maybe we should call it Method.

Parameter on the other hand feels correctly named. What we send and receive from a parameter is not a "parameter" but a parameter-change, which is the event.

tap commented 8 years ago

The term "socket" is a bit too overloaded a CS term. The term "port" is a little bit overloaded, but not so bad. Maybe the term "jack" would be better than both of them?