OOP Part 1 - Introducing CFCs

Code Examples

Static class example

The Person class does not store any data

Value Object example

The Person class just stores data, it has no behaviour. Known as a Value Object (VO) or Data Transfer Object (TDO)

Person class example

The person class has data and some behaviour

Person class example (in cfscript)

Our Person class written in cfscript

Passing arguments to an object

Passing named arguments, ordered arguments and an argumentCollection to an object


John Whish