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: Declaration of Notification Names ?  (Read 3626 times)
rbhadra
Newbie
*
Posts: 4


View Profile Email
« on: August 19, 2008, 10:15:07 »

Hi,
I want to know where one should declare notification names. It shud be declared in Proxies or in ApplicationFacade ?
I want to make modular applications so wanted to know what is the best way of maintaining notifications.
Declaring notification names in ApplicationFacade will really lengthen up the file. I was thinking to declare in a separate file called as ApplicationConstants but is there any other method of keeping the notification names..whether in proxies or applicationfacade ??
Your insights will be really helpful.
Logged
danielcsgomes
Full Member
***
Posts: 47

 - daniel@onedesign.com.pt
View Profile Email
« Reply #1 on: August 19, 2008, 10:43:03 »

Hi rbhdra,

Well, i'm not the best person to advice you but i can tell you for me what makes sense.

First, if you are using AS3 port it will depends if is multicore or Standard. When i developed my first app i always try to make my code more reusable possible and separate it into modules.

In my first application what I did was as follows:

Where had to declare a notification it was always in place that made the code more reusable, that is, imagine you have a "module" Login where you need to declare the following Notifications: "TRY_LOGIN", "LOGIN_SUCCESS" and "LOGIN_FAILED" from my point of view i declare them in LoginProxy because it is something about the Login.

In case such an application to have a ViewStack which has two components such as Login and then UserManager, here i declared the notifications in ApplicationFacade because both modules did not "know" each other, but the application has to be aware of them.

I'm studying MultiCore but for me when i start with multicore make sense declare some Notification in ApplicationFacade and other in Proxy of each Module (for me i think it always depend on the kind of the notification to declare).

I do not know if you understand my "philosophy" that thought and that seemed the right one, probably can not even be the better way.

I hope I have helped, and don't forget that is just my point of view ;)

Daniel Gomes
« Last Edit: August 19, 2008, 11:08:26 by danielcsgomes » Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #2 on: August 19, 2008, 05:31:34 »

Hi Folks,

Although this is covered in the Best Practices document, it could still use a separate FAQ with a little more elaboration, so you can find the answer here:

http://puremvc.org/content/view/93/185/

-=Cliff>
Logged
Pages: [1]
Print