About HMVC...
Results 1 to 3 of 3

Thread: About HMVC...

  1. #1
    Senior Member
    Join Date
    Sep 2011
    Posts
    258

    About HMVC...

    Well I've heard of people talking about the concept of HMVC, which is an evolved version of MVC. I know its the abbreviation of hierarchical model view controller, and that you have several layers of MVC integrated with each other. I was wondering though, are there any popular framework or applications that actually use HMVC? And more importantly, what are the benefits of using HMVC over MVC?

  2. #2
    Senior Member traq's Avatar
    Join Date
    Jun 2011
    Location
    so.Cal
    Posts
    949
    Apparently, kahona uses a HMVC pattern. I'd never heard the term before, but it's described very much like what I know as "modular MVC" - instead of one controller, there can be many (one per component or tier), with the front controller delegating tasks to them. I do this often with "widget"-like components of a site; most CMS's I've seen take a similar approach, at least with plug-ins, though they don't use the term HMVC.

  3. #3
    Senior Member
    Join Date
    Sep 2011
    Posts
    258
    Quote Originally Posted by traq View Post
    Apparently, kahona uses a HMVC pattern. I'd never heard the term before, but it's described very much like what I know as "modular MVC" - instead of one controller, there can be many (one per component or tier), with the front controller delegating tasks to them. I do this often with "widget"-like components of a site; most CMS's I've seen take a similar approach, at least with plug-ins, though they don't use the term HMVC.
    I see, so multiple controllers/view files for various components? I actually think it can be quite useful for admin control panel. Lets say you have three basic actions 'add', 'edit' and 'delete'. 'add' is one of a kind, but 'edit' and 'delete' both require an id to be processed. You can define two actions 'add' and 'manage', while have a sub-controller handling manage actions that contains 'edit' and 'delete'. The 'delete' action cannot be undone so you may want to have another controller called 'confirm', which can help nicely. I am not sure if this is the practice of HMVC, but looks quite similar.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •