INSTANCE scope is never an official scope, but it has been adapted by many CFer's (including myself) for writing CFC.
<cfset variables.instance = structNew()>
Common usages include:
- dump() private variables for debugging
- getMemento() / setMemento(struct)
However, CF9 brings lots of much needed <cfproperty> functionality:
- <cfdump> will now dump all properties
- implicit getters and setters (can be turn off optionally)
- validation on setter (optional)
- metadata for the almighty ORM with Hibernate
Unfortunately, all the properties are stored in VARIABLES scope by default, and it can’t be changed. However, since <cfproperty> has become so important and powerful in CF9, should we abandon the INSTANCE scope convention?
What do you think?