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: Notification Constants  (Read 7612 times)
martypitt
Courseware Beta
Newbie
***
Posts: 5


View Profile Email
« on: October 22, 2007, 04:07:58 »

Hi all.

I've selected PureMVC as the framework to port a large scale commercial across to -- which is currently quite a mess on the flex side.

I've read all the docs, and have my first (surely of many) question --

this application has several hundred commands and notifications.  Is it really best practice to list the constants for all of these within the ApplicationFacade class?

I'm not questioning the practice of the constants -- that makes perfect sense.  However, I wonder if this creates a maintanence issue.  Should this instead be split over seperate files?

As an alternative, does it violate any of the best practices if these are split over several static classes, all in the same namespace / package as the application facade, but broken into more logical subgroups?

These classes can then be declared as public properties within ApplicationFacade.

So, instead of referring to ApplicationFacade.ADD_EMPLOYEE, I'd use ApplicationFacade.EmployeeCommands.ADD_EMPLOYEE.

Thoughts?
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 on: October 23, 2007, 08:25:10 »

Hi Marty,

Absolutely, breaking the constants out into separate files can make sense when their volume reaches a certain point.

It could also be that breaking the application itself into separate apps could be indicated at this point as well.

If you decide to investigate that route, you might sign up for the PureMVC Courseware beta test. You'll work through a set of apps using the same Model, each with their own Facade and use cases against the common Model.

And also you might have a look at the work Nate Rock has done with Modules:
http://forums.puremvc.org/index.php?topic=49.0

-=Cliff>
Logged
martypitt
Courseware Beta
Newbie
***
Posts: 5


View Profile Email
« Reply #2 on: October 23, 2007, 02:53:36 »

Great!

Thanks for the advice, and the link.

Much appreciated.

Marty
Logged
Pages: [1]
Print