The Dopefly Tech Blog

« The Dopefly Tech Blog Main page

Fun with Functions and CFCs IX - Inverting a CFC

posted under category: ColdFusion on December 20, 2007 by Nathan

Here's something I toyed with years ago, revisited. In CF, you can turn your objects inside-out, making all the private variables and methods public. Just take a dash of part II and a little ingenuity and you get this:

myCFC = myCFC.getVariables();

Or, from within the CFC itself, or via a injected/attached method, you can do this:

this = variables;

This will replace the public interface with the private one. Hmm. I would never recommend doing that in real life, though maybe for debugging in a development environment.

Nathan is a software developer at The Boeing Company in Charleston, SC. He is essentially a big programming nerd. Really, you could say that makes him a nerd among nerds. Aside from making software for the web, he plays with tech toys and likes to think about programming's big picture while speaking at conferences and generally impressing people with massive nerdiness and straight-faced sarcastic humor. Nathan got his programming start writing batch files in DOS. It should go without saying, but these thought and opinions have nothing to do with Boeing in any way.
This blog is also available as an RSS 2.0 feed. Click your heels together and click here to contact Nathan.