views:

190

answers:

2

What are the differences (if any) between New/CreateObject() to create an object vs EntityNew() to create an entity in CF9 for persistent CFC?

+2  A: 

With New() and CreateObject() you need to specify the full path to the CFC.

With EntityNew() you just need to pass in the name of the entity.

Sam Farmer
+1  A: 

quoted from: Learning ColdFusion 9: EntityNew() vs. The NEW Operator / CreateObject()

I actually asked this question during the "Advanced ORM" session at CFUNITED and got a slightly different answer. The speaker (forgive me for not remembering his name - I think he was the head Adobe engineer), told me that when you load an object using EntityNew(), ColdFusion actually presents it in a slightly different way than a standard CFC. While this difference is not noticeable to the programmer, a component created using EntityNew() does afford some efficiencies at the Hibernate integration level. As such, he recommended that all new ORM-enabled objects be created with EntityNew().

Henry