All This "Object" StuffFor many ColdFusion users, the object-oriented programming (OOP) model is foreign territory, perhaps ominously so. It's frequently considered an advanced topic. Why? Well, other OOP languages like Java are hard to understand, so you'd think the OOP model itself must be hard to understandright? Wrong. The reputation of object-oriented programming has little to do with the reality of its concepts. Yes, most OOP language implementations are far more complex than CFML, but the concepts behind OOP are actually quite natural and are part of what you do with ColdFusion already. OOP is a way of developing applications around objects. Objects are not some arcane programming conceptthey are simply things. For example, let's look at some of what we know about the things in our movie studio application.
We didn't need to have any special understanding of the film industry to make those assertions, did we? We certainly didn't need to know the details of, for instance, how an actor goes about getting cast in a role. What we just created is really an object-oriented view of the application. There are objects (people, actors, directors, and films) and actions that can be taken on them (hiring and firing, casting, and the like). The application lets us perform those actions on those objects and do something with the result. |