Adam Cameron
// /vendor/org/group/app2/Parent.cfc (/org mapping points to /vendor/org)
component {}
// /vendor/com/corp/app1/Child.cfc (/com mapping points to /vendor/com)
import org.group.app2.Parent
component extends=Parent {}
// /vendor/me/test.cfm
<cfscript>
import org.group.app2.Parent
import com.corp.app1.Child
p = new Parent()
writeOutput(getMetadata(p).fullName) // org.group.app2.Parent
c = new Child() // errors with Could not find the ColdFusion component or interface Parent.
</cfscript>
If I change Child.cfc to be:
// /com/corp/app1/Child.cfc
component extends=org.group.app2.Parent{}
It works.
So it's not like CF can't find the CFCs in question. It's just not... looking.Adam Cameron
import
statements are clearly working in the test.cfm
file otherwise I'd not be able to create the Parent
instance at all.
😐Tim
04/12/2022, 1:30 PMTim
04/12/2022, 1:31 PMTim
04/12/2022, 1:33 PM/** some.package.interfaces.Component */
interface {
function some.other.package.interface ReturnInterface doSomething(InputInterface);
}
----------
import some.other.package.interface.*
/** some.package.implementation */
component implements="some.package.interfaces.Component" {
function ReturnInterface doSomething(InputInterface) {}
complains because "some.other.packaage.interface.ReturnInterface" and "ReturnInterface" (imported from some.other.package.interface) are "not the same."Tim
04/12/2022, 1:41 PMAdam Cameron
salted
10/06/2022, 1:25 AMAdam Cameron
import
statements are always local to the file that needs the the resource located. They do not consider how files interact / interrelate. An import is basically telling the rest of the code in that file where to find external resources.Tim
10/06/2022, 1:36 PM