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: More on organizing Notifications...  (Read 9178 times)
sideDoor
Full Member
***
Posts: 25


View Profile Email
« on: April 16, 2010, 07:30:10 »

I was wondering what you thought of this post about organizing notifications:

http://labs.almerblank.com/2009/11/organizing-puremvc-notifications/

I like the idea of a Notifications Class, typed to INotifications that implements:

function register():void;
function remove():void;

But the last suggestion in this post is also interesting, by aggregating notifications specific to areas of an application in an all encompassing Notifications Class, which could be accessed through the facade.  However, I'm not certain about breaking from the best practice of using public static constants in the concrete Notification Class (LoginNotifications) and instead using only public constants.

Please see the above post...

Could you advise on best practice here?  Thanks!
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 on: April 18, 2010, 04:46:21 »

I think it is a good way of doing it, but I haven't actually implemented based on it just yet. Your constants are still public static, they're just defined on a different class.

-=Cliff>
Logged
sideDoor
Full Member
***
Posts: 25


View Profile Email
« Reply #2 on: April 20, 2010, 05:57:01 »

Actually, if you have a glance at this fellow implementation, you'll notice he's suggesting using public const and a intermediary Class between the Facade and the individual notification Classes:

http://labs.almerblank.com/2009/11/organizing-puremvc-notifications/comment-page-1/#comment-13

What do you think of this?

Thanks man!
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #3 on: April 21, 2010, 09:14:38 »

What do you think of this?
Definitely interesting. Possibly, a smidge too complex to push on everyone as a best practice (anything more complex than tab a/slot b and lots of folks run screaming), but definitely worth investigating. It does look sensible.

-=Cliff>
Logged
sideDoor
Full Member
***
Posts: 25


View Profile Email
« Reply #4 on: April 22, 2010, 11:35:59 »

Thanks, I'll try it out on my current project and report back...I see it being pretty beneficial for modules, where you can squirrel away your notifications per module...
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #5 on: April 23, 2010, 08:52:36 »

I definitely look forward to hearing your experiences with this approach...

-=Cliff>
Logged
Pages: [1]
Print