PureMVC Architects Lounge

Announcements and General Discussion => General Discussion => Topic started by: flexphp on April 15, 2008, 03:45:30



Title: Is VO a good place for constants?
Post by: flexphp 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


Title: Re: Is VO a good place for constants?
Post by: puremvc 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>


Title: Re: Is VO a good place for constants?
Post by: flexphp on April 15, 2008, 07:11:56
Thanks Cliff!