title: When extending Magento's core classes, what XML structure do I need to alter for my changes to take effect?
body: <p>I am working with a Magento 1.3 (Community Edition) install and I am trying to extend the functionality of one of the core classes. I changed the core file directly on a development server, and got the functionality working there. Now, <a href="http://alanstorm.com/magento_upgrade_rewrite_override" rel="nofollow">following Alan Storm's advice</a>, I'm reverting the core files back to stock and implementing my changes in the <code>/app/code/local</code> tree. I've been reading Alan Storm's page and <a href="http://prattski.com/2010/06/24/magento-overriding-core-files-blocks-models-resources-controllers/" rel="nofollow">a guide from Josh Pratt</a>, but I can't quite figure out how to apply those examples to my case.</p>
  
  <p>The core of the question is - how much of the skeleton of a full-on Magento module do I need to implement in order to extend/monkey-patch core classes?</p>
  
  <ul>
  <li>Do I need to create my own namespace?</li>
  <li>When I name classes, which underscores should I expect to be syntactically significant?</li>
  <li>When I write the XML, which tags correspond to the class hierarchy and which don't?</li>
  <li>What other parts of the code will need to be changed to take advantage of my changes, if any?</li>
  </ul>
  
  <p>Basically I'd like to not cargo-cult this. </p>
  
  <p>The particulars of my scenario: I'm trying to alter the product review functionality of Magento. The code for this functionality lives in <code>/app/code/core/Mage/Review/</code>. I'm adding an additional step to the server-side validation when new reviews are submitted (our store is having a spam issue, so I'm adding an extra form field, hiding it from humans with CSS, and throwing out reviews that fill in that form field; I'm doing it this way because CAPTCHAs are a sub-optimal UI choice). I added code to <code>/app/code/core/Mage/Review/controllers/ProductController.php</code>'s Mage_Review_ProductController->postAction() method and to <code>/app/code/core/Mage/Review/Model/Review.php</code>'s Mage_Review_Model_Review->validate() method. </p>
  
  <p>I then isolated the added code, put it into <code>/app/code/local/Mage/Review/controllers/ProductController.php</code> and <code>/app/code/local/Mage/Review/Model/Review.php</code>, used the "class My_Review_Foo extends Mage_Review_Foo" and "parent::method" recommendations from Alan Storm's tutorials. That, predictably, broke the product pages. So I'm working on <code>/app/code/local/Mage/Review/etc/config.xml</code> and trying to figure out how to get Magento to use my classes to <em>extend</em> the core classes. Unfortunately, I can't tell what the underlying logic to the XML is, so I can't figure out how to construct the right XML to tell Magento - "use my classes instead of the core classes, whenever you would use the core classes."</p>
  
  <p>It looks like pretty much any change to the core classes ends up needing the full pomp and circumstance of a Magento plugin. Is that correct? How much do I actually need to do to shim my changes in, and what's the logic behind doing it that way?</p>