We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22303 MODX Staff
    • 10,725 Posts
    Well, Elements, yes, TV’s not really (these are now ContentElements); I added MetaElement class and implemented it yesterday, and today I’m moving all security to PermissionElements and adding hierarchical relationships between all Elements so you can attach PermissionElements, MetaElements, or anything else to Resources or other Elements (in the case of attaching to Elements, this just means that you can chain elements together). So attach a PermissionElement to something, and it’s secured, or can be evaluated to determine if it’s secured conditionally.

    So many more tables are going away! Yeah!!! This will simplify caching and everything else, since all we have to deal with are Resources and the Elements that are related to a Resource or related to another Element already related to the Resource. The bigger advantage is that all Elements can define default content, and supports Resource overridden content (via ResourceElementContent), AND, can support multiple revisions in various cultures. And, can be isolated by Context! We can ship with default sets of metadata or offer vertical industry metadata sets that can be used to handle publishing workflow, or any other application data related to Resources or Elements.

    The simplified structure is making it super easy to extend functionality. All this MetaElement, PermissionElement stuff came to me after I already refactored the structures once and was completing the implementation of the other elements. Very cool stuff...
      • 1764
      • 680 Posts
      Sounds awesome. You seem to be headed exactly where I think we need to go. If you ask me the #1 problem with MODx and Etomite especially is there is not enough reusable code. If you boil everything down to it’s most basic level keep it generalized and extendable, all of the sudden everything get’s so much more simple and flexible becase you have a reusable, streamlined and standardized foundation to work with.
        • 22303 MODX Staff
        • 10,725 Posts
        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... laugh

        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.
          • 22303 MODX Staff
          • 10,725 Posts
          Oh, and did I mention it’s rendering the default content from MODx (minus a couple of snippets I have yet to convert) in about 0.6 seconds on average, with absolutely no caching in place. Most of this is, as I said, related to class include time, but with appropriate caching, we should definitely be able to get back down to the .1 to .4 second average rendering benchmark of the current MODx system using cached pages.
            • 1764
            • 680 Posts
            Very cool!

            That class session persistence stuff sounds very intriguing. I’ve looked into the new Reflection API stuff a bit too and it also seems very cool. I need to take some time to get more familiar with it one of these days. Keep up the good work!
              • 32963
              • 1,732 Posts
              Very nice work guys. The OO stuff discussed here is very good and looks promising.

              As it relates to moving stuff from site content I’ve came up with a similar design that will allow the sysem to have two master or core tables:

              1) ObjectCore
              2) ObjectAccess

              These two table will form the base for all other tables within the system. This means that the database tables will be handled in the same way class inheritance is handled.

              ObjectAccess will also allow you to assign permission based on user groups or individual access.




                xWisdom
                www.xwisdomhtml.com
                The fear of the Lord is the beginning of wisdom:
                MODx Co-Founder - Create and do more with less.