Yeah, my favorite implementation so far is the PluginElement class, extended from ScriptElement, which boils down to the following code, minus the comments:
class PluginElement extends ScriptElement {
public function __construct() {
parent::__construct();
$this->setClassKey(ElementPeer :: CLASSKEY_2);
}
public function process($properties= null, $content= null) {
$this->instanceOutput= parent :: process($properties, $content);
echo $this->instanceOutput;
} // process
} // PluginElement
Nice and concise...
Once I get the Base object classes shaved down using Reflection techniques, and implement the fastest caching mechanism I (or someone else) can come up with, I think we’ll have a truly robust implementation of the concepts brought into being by Etomite/MODx.
Plus, when PHP 5 introduces a way to persist class definitions in memory between requests, we can get rid of all of the include time of the object model; I’ve seen some mention of this in various contexts (especially on the Propel dev list) and it quite frankly will be a PHP feature that could quell all those who claim PHP cannot compete with Java in the enterprise markets, because of performance or scalability issues.