What is the HMVC pattern?

Viewed 60328

Reading Kohana's documentation, I found out that the main difference in 3.0 version is that it follows the HMVC pattern instead of MVC as version 2.x does. The page about this in Kohana's docs and the one on wikipedia didn't really give me a clear idea.

So question: what is the HMVC pattern and how does it differ from MVC?

5 Answers

HMVC is closely related to the "component based" approach to dispatching. Basically, instead of having a single dispatcher, which delegates to a controller, each controller can act as a dispatcher it self. This gives you a hierarchy of controllers. The design is more flexible and causes better encapsulation of code, but at a price of higher abstraction. Konstrukt is designed around this pattern.

See also this answer: https://stackoverflow.com/questions/115629/simplest-php-routing-framework/120411#120411

Related