PureMVC Architects Lounge

Announcements and General Discussion => General Discussion => Topic started by: nilsm on January 16, 2008, 12:02:51



Title: What is the Notification type for?
Post by: nilsm on January 16, 2008, 12:02:51
Hi all,

very simply put:

- what is the Notification 'type' property for?

:)

cheers - Nils.


Title: Re: What is the Notification type for?
Post by: Joel Hooks on January 16, 2008, 05:31:15
I use it to pass a string that defines the type for notifications that are 'dynamic', so then observers can tell what my intention is depending on current state of the application.


Title: Re: What is the Notification type for?
Post by: puremvc on January 16, 2008, 08:31:55
The type parameter can be used as a discriminator to allow a mediator or command instance that has been notified determine if it really needs to take action. This can help reduce the overall number of notification names in the system.

-=Cliff>


Title: Re: What is the Notification type for?
Post by: nilsm on January 18, 2008, 08:26:00
Joel, I like that usage - it removes some of the guesswork, especially if several developers are involved. I actually thought that's what the parameter's intention was (going from the name too) but then saw other examples that worked in a different way.

Cliff - I understand what you are saying. At the moment it's a little hard for me to see the benefit as it just seems to increase the knowledge you need to have about each notification. I guess it's a matter of providing thorough documentation.

cheers - Nils.