Cfcomponent - Should You Use the Name="" Attribute?

Charlie Arehart has an interesting post here on whether you should use the name attribute in cfcomponent.

Apparently there is no ‘name’ attrbribute in the cfdocs for <cfcomponent>, remember you can use displayName or hint for component introspection. And if you want to take advantage of getMetaData()? Well there already is a ‘name’ attribute as default in ColdFusionMX! The thing is that’s it’s for internal use and even if you do use ‘name’, the value you specify won’t appear in getMetaData(), the internal ColdFusion value will instead!

Most interesting that IDE’s like cfeclipse have ‘name’ as part of the code completion, as Charlie says…it’ll be interesting to see how the community resonds to this one :)

Note that it is actually legal to add as many non-official attributes to <cfcomponent> and <cffunction> for your own documentation (when using component introspection). Very nice!

Comments