Setup scripts are versioned. It is known. As a result, any time you use a reference from an external object or class, you run the risk of the setup script itself changing ex post facto. For example, suppose I want to insert a new status that is the default for the "New" state:
$tbl = $installer->getTable('sales/order_status_state');
$fields = array('status', 'state', 'is_default');
$values = array(
'unsubmitted',
Mage_Sales_Model_Order::STATE_NEW,
'is_default' => 1,
);
$conn->insertArray($tbl, $fields, array(array_combine($fields, $values)));
Maybe it's unlikely that a future release of Magento would change the value of Mage_Sales_Model_Order::STATE_NEW, but it could happen, and if it did, this setup script would have the same version number(s), but produce different results. That's bad!
The real question here is that good programming practice tells me that I shouldn't have the string 'unsubmitted' in my code/config more than once. I would really like to put it in config.xml, actually, but I can't, because if I do that then future versions of this setup script can change meaning without actually changing the code of the setup script.
Has anyone found a reasonable compromise between hard-coding values into setup scripts and maintaining pure differences between versions?