本文介绍了用于 Web 应用程序开发的 MVC 与 HMVC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 MVC 模式进行 Web 开发.我使用 codeIgniter 框架.我找到了 http://fuelphp.com/http://kohanaframework.org/ ,他们正在使用 HMVC.仍然不清楚 HMVC 以及为什么我们应该使用 HMVC 而不是 MVC ?阅读 HMVC 模式后我很困惑,它与 MVC 没有太大区别.您能解释一下为什么我们应该使用 HMVC 进行 Web 应用程序开发吗?

I'm using MVC pattern for web development. I use codeIgniter framework. I found http://fuelphp.com/ and http://kohanaframework.org/ , they are using HMVC. It still not is clear of HMVC and why we should use HMVC instead of MVC ? I am confused after reading HMVC pattern and it's not too much different from MVC. Can you explain why we should use HMVC for web application development ?

推荐答案

HMVC 是作为一个整体运行的传统 MVC 三元组的集合应用.每个黑社会是完全独立的,可以执行没有任何其他人的存在.对三合会提出的所有请求必须使用控制器接口,从不加载模型或库在他们自己的域之外.三合会内的物理位置托管环境并不重要,只要可以从系统的所有其他部分.HMVC的鲜明特点鼓励重用现有代码,简化不同的测试系统的一部分,并确保应用程序很容易增强或扩展.

HMVC is a collection of traditional MVC triads operating as one application. Each triad is completely independent and can execute without the presence of any other. All requests made to triads must use the controller interface, never loading models or libraries outside of their own domain. The triads physical location within the hosting environment is not important, as long as it is accessible from all other parts of the system. The distinct features of HMVC encourages the reuse of existing code, simplifies testing of disparate parts of the system and ensures that the application is easily enhanced or extended.

来自 使用 HMVC 扩展 Web 应用程序作者:Sam de Freyssinet

From Scaling Web Applications with HMVCby Sam de Freyssinet

这篇关于用于 Web 应用程序开发的 MVC 与 HMVC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-14 03:43