We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!

MVC

    • 4673
    • 577 Posts
    @ taken from phpclasses.org

    1. Damn Small MVC - This class support forum

    Short description:

    Light weight MVC implementation framework
    Supplied by:
    Gregory

    Detailed description:

    This package light weight implementation of Model-View-Controller software architecture in PHP.

    It can read the structure of a pages of the site from a definition file that is processed to determine how to dispatch the current page request.

    It can generate the presentation of each page using templates that can be compiled and have the compilation results cached in local files to avoid processing overhead next time the same template is used.

    The output of the pages may be served in compressed format using gzip output buffer handler.

    @ MVC
    I’ve always been a fan of this approach. Anybody else have comments or ideas about this type of approach?
      Tangent-Warrior smiley
      • 25663 MODX Staff
      • 12,272 Posts
      ’Tis a very good approach indeed... might just see something of this in the future. wink
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 34017
        • 898 Posts
        I have been looking into the MVC approach a lot the last few weeks - inspired by codeigniter. I was wondering what the MODx dev’s thought about this. How do you see MODx’s approach right now?

        1. Templates - would be the View
        2. Snippets, plugins, and Modules - would be the Module and Component? Do you seperate these when you create custom addons (using MODx as your framework)?

        One difference I really like about MODx is being able to put in snippet/chunk/TV in any content item. 1 last one - do you forsee MODx taking a more MVC approach as we move closer to Tattoo/1.0?

        Chuck
          Chuck the Trukk
          ProWebscape.com :: Nashville-WebDesign.com
          - - - - - - - -
          What are TV's? Here's some info below.
          http://modxcms.com/forums/index.php/topic,21081.msg159009.html#msg1590091
          http://modxcms.com/forums/index.php/topic,14957.msg97008.html#msg97008
          • 25663 MODX Staff
          • 12,272 Posts
          The MVC model is really great, but comes with complexity and potentially heavy resource requirements. Rails implementation is one such example. Jason will have lots more to say on this subject.
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • 32963
            • 1,732 Posts
            I for one like the MVC and the Observer Patterns.
              xWisdom
              www.xwisdomhtml.com
              The fear of the Lord is the beginning of wisdom:
              MODx Co-Founder - Create and do more with less.
              • 18397
              • 3,250 Posts
              I dislike the forced MVC format that most frameworks use. Its too confining. Yes it prompts more organized code but it comes at the expense of simplicity.
                • 22303 MODX Staff
                • 10,725 Posts
                Quote from: xwisdom at Aug 13, 2006, 08:33 PM

                I for one like the MVC and the Observer Patterns.
                Me three; I think Ryan was just misquoting some of my rantings about MVC and PHP, which are generally, what he calls whooshy smiley Or maybe he was just wanting me to respond...well, now here we go... LOL

                Indeed, they are key patterns in modern software architecture, and IMO, the MODx approach to templating, combined with traditional MVC and some newer patterns, patterns that have evolved out of years of experience implementing variations of the MVC pattern, provides the next generation of MODx a rare opportunity to evolve into a very agile and robust framework for developing web applications, with the same freedom of expression and ease of use we’ve all come to love.

                From my perspective, most of the implementations of MVC architectures in PHP are a bit heavy and tend to either provide too much, or aren’t useful unless you are a very adept object-oriented programmer. This, too me, is not taking advantage of the major stengths of PHP as an interpreted templating language that is easy to use. My work with the MODx code since we started the project, along with research into various PHP MVC-style frameworks over the past 2 years, provoked my original prototype back at the beginning of the year and has fueled the ongoing development of my object-oriented rewrite of MODx ever since.

                In this rewrite, what is referred to as a document/page currently, or what I will call a Resource (as in URI, or Universal Resource Identifier), represents an aggregation of what I consider small, specialized Application Controllers. Each little Application Controller, or Content Element as I prefer to refer to them, has access to other controllers in a loosely coupled fashion, and all have access to the Model, or data layer, directly or through another controller. In a sense, these Elements (think Snippets, Chunks, Templates, TV’s, Plugins, etc.) are individual Views from traditional MVC, with a lot more power and flexibility. Then you have the Front Controller, part of a more complex MVC-inspired pattern, which is simply the php page (like the current index.php) that is calling MODx Resources (again, just a collection of application controllers or Content Elements). Those Resources could be page resources, rendering a simple web page, or web link resources, or any number of xml-rpc services, ajax services, or custom page resources with custom behavior defined for it. And you can have any number of Front Controllers, too, called Contexts. This sounds complex, but really, it boils MODx down into three basic concepts, various Contexts of Resources that produce content via Elements, or in MVC lingo, various front controllers aggregating application controllers to producing dynamic views of the model.

                Anyway, enough techno-babble I suppose, but combined with some exciting work we’re beginning now with the Dojo framework and it’s powerful AOP architecture, as well as my xPDO project for managing persistence and building consistent API’s that are easy to use, and even easier to extend, I’m truly excited about what I believe will help further distinguish MODx as a revolutionary approach to open-source content management with PHP. Now, back to the work of getting it all ready to show off...
                wink
                  • 31337
                  • 258 Posts
                  Quote from: rthrash at Aug 01, 2006, 08:55 AM

                  The MVC model is really great, but comes with complexity and potentially heavy resource requirements. Rails implementation is one such example. Jason will have lots more to say on this subject.

                  I suspect you’re confusing design and implementation in this case. Building a modern day client/server app without an MVC design is a recipe for masochistic delight.
                    • 25663 MODX Staff
                    • 12,272 Posts
                    I was actually more specifically relating some folks experiences with the RoR implmentation from 6 or so months ago. I’m sure it’s better now, or maybe not. smiley
                      Ryan Thrash, MODX Co-Founder
                      Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                      • 27226
                      • 186 Posts
                      Maybe the question is, whether a framework is an app.
                      (EDIT: the MVC-issue is for apps, not for frameworks, I guess.)
                      MODx claims to be both, so Jason is facing a real challenge. And even more since a lot of technologies has to be integrated: SQL, PHP, JS and higher level frameworks made from this basic tech, like xPDO, dojo...
                      So, in a way it seems to be a "framework of frameworks" - and a running MODx-app on top of it all.

                      I’m truly excited about what I believe will help further distinguish MODx as a revolutionary approach to open-source content management with PHP.

                      Indeed! It sounds really exciting, even to me, who’s not a Pro in this type of matter.
                      I heard of this "AOP" stuff for the first time here. MODx is going to be my "learning-tool" in far more respects than I thought... smiley