Articles about CFC
-
Aug 2010 about Coldfusion CFC private
If you are familiar with OOP, you know that there are basically 2 types (scopes) of variables and functions:
- Private: only available within the object itself
- Public: also available to the caller, outside the object
(There are other scopes as well but I leave them out to keep things focused in this article)
To know what's available publicly, we can either read the documentation or use some functions like cfdump in Coldfusion.
But what about the private ones? How can we know what variables and functions are available privately inside the object? I know there are many good reasons for things to remain private and I totally agree that is the good architecture. But there are times I want to know how the internal variables change, what values they are holding at runtime. This is especially useful for debugging purpose. Read full article.
-
Sep 2010 about scope variable CFC Coldfusion
While fixing my cfTrigger framework recently, I realized that I have messed up the scopes of variables inside cfcs seriously! I omitted the var keyword for local variables and used This keyword where it should have been Variables. So before continuing to fix it, I decided to take a step back and learn again in a more proper way what variable scopes are available in Coldfusion cfcs and how to use them correctly. Read full article.