FILE ID: /techblog/234_Fun-with-Functions-and-CFCs-IX-Inverting-a-CFC/ Dec 20, 2007

Fun with Functions and CFCs IX - Inverting a CFC

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.