One of my favorite new features of Coldbox 3.0 is the ability to have a CFC only config file. Thats right, no more XML. No don't get me wrong, XML has its place, but I love the ability to get funky with my config file. With it now being a CFC, I can do some crazy cool stuff.
For example
- I can now have my config files all extend a base config file or any other CFC, now thats cool.
- I can get creative with defining my enviromental variables, or create any other kind of helper functions.
- I can easily set a variable anywhere in the config file and EASILY refer to it.
These are just a few of the ways that I have already taken advantage of the Config.cfc.
What are some ways you have? Feel free to comment with any crazy or funky ideas you've used or plan to use with a fully ColdFusion-ifide (its a word, look it up) config file, I'd love to hear them.
Add Your Comment
(4)
Jun 29, 2010 22:41:08 UTC
by John Farrar
OK... now this makes me curious if it will be easy for me to use COOP and/or CFish with ColdBox now. :)
Jun 29, 2010 22:55:58 UTC
by Doug Boude
I personally was so intrigued with this feature in Coldbox that I dissected it to find out exactly "how" it works and learned a LOT about implementing the decorator pattern in CF in general! I haven't used the config CFC to do anything uber funky, but the freedom it allows to be able to utilize CF functionality directly within one's configuration is priceless! For instance, populating a variable that contains a calculated date, like "X days till Christmas".
Jun 30, 2010 08:46:23 UTC
by Curt Gratz
Doug, I remember reading some posts you did about creating a CFC Config file. They were some good stuff. Oh, and setting configuration settings that change on certain dates, now that is a cool idea. Maybe change up all your Layouts around holidays to be a holiday theme automatically. I could use that.
Jun 30, 2010 10:42:37 UTC
by Luis Majano
WOW! That is really funky, I like that! Get your xmas themes up and ready now! I also use it to instantiate external API's or factories or whatever, then just place them on the cache directly or in the settings structure. You have full control now and I love that!