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: Is VO a good place for constants?  (Read 8280 times)
flexphp
Jr. Member
**
Posts: 17


View Profile Email
« on: April 15, 2008, 03:45:30 »

Hi all,

For constants that are only used along with the use of a VO, can that VO hold the constant definition?

Ex.: a UI component ACL state (READ_ONLY | MODIFY | ACCESS_DENIED)

Thus in a complex nested components view with a single mediator managing them, there would be no need to pass the constants definitions down the UI hierarchy, the VO would transmit it.

Good Parctice?

Many thanks,

Cheers
Patrick
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 on: April 15, 2008, 06:15:13 »

Nothing wrong with that, makes perfect sense.

Also you might use an Enum if you want another actor to know the valid set of constants.See the use of enums in the Flex EmployeeAdmin demo.

-=Cliff>
Logged
flexphp
Jr. Member
**
Posts: 17


View Profile Email
« Reply #2 on: April 15, 2008, 07:11:56 »

Thanks Cliff!
Logged
Pages: [1]
Print