This content has been marked as final. Show 2 replies
> In my situation I have a ton of Java classes that Id like to extend using
> CFC's. My question is can CF inheirit from a Java class just like it does a
Just because a CFC compiles down to a Java class, doesn't mean it *is* a
Java class. A CFC can extend another CFC. That's it.
I imagine the closest thing you could do for your requirement is to
re-implement the entire Java class in CF. Not so nice.
PS: "name" is not an attribute of <cfcomponent>, and can adversely conflict
with CF's internal operations when building metadata,leading to
"unexpected" results. Probably best to avoid that one. I don't think it
serves any purpose adding a name attribute anyhow, as the CFCs metadata
includes its (correct) name automatically anyhow.
Adam, thanks for your reply. I had a hunch that it wasnt possible but wasnt entirely sure. Certainly would be a very nice feature to have implemented in CF though.
In any case, that only leaves me one more option and thats creating a facade for both classes. Basically what I have done is created a CFC called cfc.facades.Category which is what I always implement instead of the java one. In the constructor I init 2 classes, the first is the java class and the second is another class I have made in CF called rzCategory.
Please check out this thread for exactly how I am doing this : Thread