If you develop an extension for personal use that is supposed to work only for you project build on Magento 1.6+ then there are no worries. You should only override Mage_Catalog_Model_Resource_Category_Flat
by adding this in the config.xml
file of your extension:
<models>
<catalog_resource>
<rewrite>
<category_flat>Namespace_Module_Model_Resource_Category_Flat</category_flat>
</rewrite>
</catalog_resource>
</models>
If you are building an extension and you want it to work on version before 1.6 you need to override the Mage_Catalog_Model_Resource_Eav_Mysql4_Category_Flat
class also. In this case your config.xml
section should look like this:
<models>
<catalog_resource><!--used for 1.6+ -->
<rewrite>
<category_flat>Namespace_Module_Model_Resource_Category_Flat</category_flat>
</rewrite>
</catalog_resource>
<catalog_resource_eav_mysql4><!-- used for versions before 1.6 -->
<rewrite>
<category_flat>Namespace_Module_Model_Resource_Eav_Mysql4_Category_Flat</category_flat>
</rewrite>
</catalog_resource_eav_mysql4>
</models>
You should put all your logic in Namespace_Module_Model_Resource_Category_Flat
and the class for versions before 1.6 should look like this:
class Namespace_Module_Model_Resource_Eav_Mysql4_Category_Flat extends Namespace_Module_Model_Resource_Category_Flat
{
}
This way both versions use the same code.