ATK/meta vs postMeta

From Achievo/ATK Wiki

Jump to: navigation, search

In a recent skype chat with a few colleagues, Ivo Jansch explained the difference between meta() and postMeta() for the meta nodes with a nice analogy. The analogy is too good to keep private, so I am publishing it here with his permission:

 * anything you want to change can be done in postMeta
 * only rarely you need to manually add stuff in the meta function
 * the policy is named policy because it enforces a standard on how to map database stuff to the application
 * in the meta function, this policy can be influenced
 * compare it to pregnancy
 * meta() is what happens inside the female
 * based on dna, policies, whatever food she happens to be eating etc, the baby is constructed
 * once it's born, you give it clothing etc.
 * sometimes however, you need to do surgery on the pre-born
 * if you wait until postmeta, it is either too late, or inefficient
 * which is why some stuff is done in meta()
 * e.g. if the womb is constructing a boy but you want a girl, you could let it be born first and then do a gender change
 but that's a lot of overhead
 * so for performance reasons, you might change the gender before the utensils are appended to the unborn
 * (which is basically what things like $policy->setTypeAndParams do
 * (to make it a little more complete, even metanodes have a constructor, but that would then be comparable to conception, and you don't want to fiddle with stuff there yet)
Personal tools
Navigation