Wednesday, August 09, 2006

CFCs are objects, kind of

To understand CFCs it's important to understand a bit about objects.
But first, a necessary qualification—CFML is not an object-oriented language, and CFCs don't provide all the features and functionality typically provided by OOP languages. This isn't a bad thing—actually, I think the opposite is true. Objects have too long been the exclusive property of languages and syntactical rules that are unnecessarily complicated. There's no reason for developers using rapid development languages, like CFML, not to be able to leverage this type of technology too. Thus the CFC.
At their simplest, and at the risk of offending OOP purists, objects are simply reusable application bits. They are black boxes—magical things that do stuff, whatever you define that stuff to be. If this sounds a bit like custom tags, well, there are similarities,but objects typically do more than custom tags. For example, they often contain not just code (like custom tags) but also data, allowing data and any code that accesses it to be cleanly encapsulated. Objects usually have multiple entry points (methods). They provide a mechanism to automatically run initialization code regardless of the entry point (a constructor). Objects can be adapted and modified, leveraging existing code without actually modifying (and potentially breaking) any of it in the process (inheritance).

0 Comments:

Post a Comment

Links to this post:

Create a Link

<< Home


Business | Health | Fitness | Home & Family | Internet | Money | Marketing & Ads | Entertainment Sports | Society & Culture
Forum | Oracle | Programming | SAP/ABAP | Data Warehousing | Great Plains | Store
Coldfusion Guide | Edu - Softwares | Graphic Softwares | Internet Banking | Linux Fax | Skin Cancer | Web Design