Matt, do you know of a good rundown on the difference between This and Variables scope in a CFC? I have a basic understanding of it but it is always been something I wanted to make sure I understood the fine distinctions in, kind of like the difference between var scoped variables and the local scope in CF9.
Cheers, Judah On Tue, Oct 5, 2010 at 3:00 PM, Matt Quackenbush <quackfu...@gmail.com> wrote: > > I don't think I am actually understanding the question at hand, but > hopefully this will at least help you out. > > First of all, I would strongly discourage anyone from using the "this" scope > of the CFC. There are a variety of reasons for that recommendation, but > chief among them is the ability to access and change the instance data from > outside of the object. > > Instead, you will want to use the "variables" scope, and have getX() and > setX() methods to access/change the instance data. > > Now then, if you are wanting a struct representing the instance data, then > you would create a getMemento() method to return that, which would look > something like the following: > > public struct function getMemento() > { > // duplicate it so the internal data cannot be changed outside of the > object > return duplicate(variables); > } > > These are just general guidelines and may/should change based upon your > actual needs. > > HTH > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337881 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm