PureMVC Architects Lounge

Announcements and General Discussion => Getting Started => Topic started by: sideDoor on April 16, 2010, 07:30:10



Title: More on organizing Notifications...
Post by: sideDoor 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/ (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!


Title: Re: More on organizing Notifications...
Post by: puremvc 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>


Title: Re: More on organizing Notifications...
Post by: sideDoor 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!


Title: Re: More on organizing Notifications...
Post by: puremvc 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>


Title: Re: More on organizing Notifications...
Post by: sideDoor 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...


Title: Re: More on organizing Notifications...
Post by: puremvc on April 23, 2010, 08:52:36
I definitely look forward to hearing your experiences with this approach...

-=Cliff>