Tom Muck wrote a good blog entry today talking about weirdness he say when he did a structCopy() operation on a CFC. To me, this was obviously a misunderstanding. CFCs aren't structs. But, like I mentioned in my post a few days ago, it can be confusing. My earlier entry mentioned how duplicate used to work on CFCs, but it returned something that wasn't really a CFC. It seems like structCopy has the same issues. You can see this clearly if you dump a CFC and compare it to the dump of a structCopied CFC.
So - remember - you can't duplicate or structCopy a CFC. Duplicate will throw an error in recent versions. StructCopy, unfortunately, will not. I'm going to file a bug report on this now.
Archived Comments
How about StructAppend? I just read Hal Helm's CFDJ article on Mixins and he used StructAppend to add methods from one CFC to another.
Your thoughts?
Matt,
Just curious, why would you need to structAppend, compared to simply extending an existing .cfc?
If it works, it's a bug. Unless it creates a ref.