In ColdFusion 10 by setting <cfset THIS.invokeImplicitAccessor = "true">
in application.cfc We can now access any property belonging to a cfc directly.
I am not sure why a developer will use this kind of functionality.
My question, is this not violating data hiding principle of object oriented programing?
Implicit accessors are an established OO-esque (they're really not an OO concept per se; it's just syntactical sugar) concept (see C#'s docs for accessors). This is just the CFML mechanism for switching them on (they are not on by default). I do not see how this has any relevance to "data hiding principles".
All it does is mean instead of doing this:
One can do this:
With the latter syntax,
getProperty()
is still called, it's just called implicitly.