Entries Tagged as ColdFusion

Variables.Instance

Posted on June 22, 2007 in ColdFusion, Object Oriented Development

This week I was walking through some code in a code review and the question came up, why do I use the "extra" instance structure within my components.  For example, in my init() function for every component, I have a line of code that looks like this:

<cfset variables.instance = structNew() />

Then, when I setup a new attribute for the component, I would store it in a variable like this:

<cfset variables.instance.foo = "bar" />

So, beyond personal habit, why do I do this?

What does Object Oriented Programming do for Me?

Posted on April 16, 2007 in ColdFusion, Object Oriented Development

In some respects, with the release of ColdFusion MX 6/6.1 and the beginnings of some object oriented (OO) capabilities in ColdFusion, the developer community has been split. On one side, there are those developers who came from Java, SmallTalk, .NET or some other object oriented capable language and were able to pick up the concepts of object oriented application development in ColdFusion fairly easily. On the other side, are the developers who came into ColdFusion new, or at least without any object oriented development experience.

To many of these developers whose tried and true procedural methods have worked just fine so far, object oriented development is completely foreign and un-trusted. I was talking with one such developer the other day, that had been presented with an opportunity that required object oriented development skills. So, what benefits do you give a procedural programmer for shifting to object oriented development when their procedural ways have been serving them just fine for many years?