Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Pages: [1]
Print
Author Topic: What is the Notification type for?  (Read 9019 times)
nilsm
Jr. Member
**
Posts: 19


View Profile Email
« on: January 16, 2008, 12:02:51 »

Hi all,

very simply put:

- what is the Notification 'type' property for?

:)

cheers - Nils.
Logged
Joel Hooks
Courseware Beta
Sr. Member
***
Posts: 146


baby steps

 - 46288188  - passport@provinsal.com  - joeltuff
View Profile WWW Email
« Reply #1 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.
Logged

http://joelhooks.com - my ramblings about developing with actionscript and python using pureMVC and django respectively.
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #2 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>
Logged
nilsm
Jr. Member
**
Posts: 19


View Profile Email
« Reply #3 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.
Logged
Pages: [1]
Print