Thanks Barney. I did once use an included constants file as you
described but have moved on to a object version of it. I suppose it
encapsulates how the constants are created, but does have the extra
level of indirection you described.

I had another thought about this; I am not keen on changing all of our
current object to extend a base object so what about having a function
getConstants() mixed into all of the existing objects. The object
factory could add a getConstants() function to each object as they are
requested. I haven't tried this before but I assume it would work?
Something like this in the factory:

<cfset object.getConstants = applicationConstants.getConstants>

Regards
Kevan

On Nov 26, 4:13 pm, "Barney Boisvert" <[EMAIL PROTECTED]> wrote:
> A third option would be to have an app_constants.cfm file that every
> CFC includes in the psuedo-constructor area.  An object that contains
> constants is kind of a kludge in my opinion (though one that I've
> definitely used, and do so to this day ;) ).  This is somewhat
> analogous to an static import in Java, and feels a bit better to me.
> This approach also allows you to simply dereference the constants
> directly without needing to scope them onto whatever object contains
> them.
>
> cheers,
> barneyb
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CFCDev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfcdev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to