by Doug Boude, CFUnited Correspondent
After a successful rallying keynote by Ben Forta, Nic Tunney's rendition of beginning object-oriented programming was the first session of the conference that I attended and, although I already have a solid grasp on the topic, I didn't walk away from this one without picking up a few new tidbits.
The room was packed, evidence of the CF community's unanimous embrace of object-oriented methodologies and the fact that OO isn't just a buzzword anymore. Nic's presentation style and the potentially daunting topic were a perfect match, as he painlessly walked his audience through some of the questions and terminology that accompany OO.
"Why OO?" was the first question Nic explored. His list of "ilities"...scalability, uniformity, reusability, maintainability...all of the things that we have always striven for when building an application are the reasons why OO is worth the investment of time to learn. Although Coldfusion is not a true OO language, its chameleon-like ability to slip in and out of object-oriented mode as it best suits our applications make it, in Nick's opinion, even better than Java as a web programming language. Nic was also careful to impress upon us that OO is not a language, but rather a collection of concepts and patterns that help us to accomplish that list of "ilities" mentioned previously.
Another highlight was Nic's discussion of just what the term "class" really means in an OO context. Although I thought his explanation was delivered slightly over the head of the general audience, the distillation is that a class is the definition or the blueprint that we use to create real live objects in our applications. In our Coldfusion world, a CFC IS a class. Think about it: it's really just a text file, right? A text file that contains the definitions for functions, variables, functionality...all things that aren't useful until we call upon that CFC within our application. Which brings us to the next relevant definition, that of "object". An object is an instance of a class; in other words, when we set a variable using "createObject" as the value, as in <cfset objUser = createObject("component",user)>, the variable objUser contains a living, breathing instance of the 'user' CFC (class).
Encapsulation, polymorphism, inheritance and composition were a few more of the terms Nic explored with us, with a well handled question and answer period following. It was an excellent start to the conference, I must say. Kudos, Nic!