Can anyone from the CF Team explain the point of `...
# adobe
a
Can anyone from the CF Team explain the point of
myObj = new Component("path/to/Some.cfc")
, as per https://helpx.adobe.com/uk/coldfusion/using/whats-new-coldfusion-2018.html#new:~:text=empObj%3Dnew%20component(%22path/to/employee.cfc%22)
(and sounds like this is one for you too, @saghosh;-))
m
Just to clarify, are you asking what exactly it DOES? Or why we added it? Cuz... lol man, that's 6 years ago. Also, are you specifically asking about the new component portion or all of the functionality added (some of which I think was removed, I don't think you can do this for CORBA anymore).
a
What it does that differentiates it from
new SomeClass()
or
createObject("string.path.to.SomeClass")
. I mean somewhere someone raised a ticket for it as a new feature, a product owner and technical lead discussed it and went "yeah this is Good use of our time because [reasons]". I'm wondering what the [reasons] were. They should be on the ticket, right?
t
hmm. I hadn't noticed this one, but I'd find it useful. We have a bunch of dynamic calls to
createObject
where we have to convert all the slashes in a file path to dots to create the object. Taking out that step would simplify things. But why they didn't just allow slashes in
createObject
or
new
isn't really clear to me.
m
In Ben Nadel's blog post at https://www.bennadel.com/blog/4145-from-coldfusion-10-to-coldfusion-2021-preparing-for-some-blog-love.htm he mentioned "This will be super helpful as I've had to jump through many hoops in the past to invoke ColdFusion components that live above the contextual directory." I'm not positive what he means, but without testing it myself I assume he means it supports directory notation such that "../SomeComp.cfc" would refer to the component in the parent directory.