Coldfusion Components inheritance question

131 Views Asked by At

Today I learned something I should have learned long before. I am working on an application written in CF years ago. I saw components calling each other by creating object every time without using inheritance. So, I decided to add inheritance to the CFCs. But I got distracted and ended up with empty "extends" attribute to one of the CFC's component tag.

I completely forgot about that and due to my rawness with git and between multiple commits I kind of lost track of that empty attribute.

Now when I actually started testing, the component wouldn't get created and the error I got back was "Invalid component or interface name." It clearly is there but CF was giving this misleading error.

Aside from the fact that I need to be more informed about how to track changes while using git, my question is if no "extends" attribute is specified what do CFCs extend.

Having an empty "extends" attribute means what? I tried to google for answers but couldn't find anywhere. So thought would ask here.

1

There are 1 best solutions below

2
Adam Cameron On

Having an empty "extends" attribute means what?

It means you've got an error in your code, and the very error you include in your question is the the result of this.

"Invalid component or interface name." 

That's pretty clear. The extends attribute takes a string attribute value that needs to point to another component or interface. For all intents and purposes when you have component extends without giving it a value, you have given it an empty string as a value, and that is... drum roll... an invalid component or interface name. Which is what CF is telling you.

There's no trick to it or odd behaviour here. You have an error in your code and CF is telling you you have an error, and telling you what the error is.