开发者

Is MVC a golden hammer for web apps?

The more I look around I see MVC. Except Drupal most of the good PHP CMS systems now rely on MVC. In fact the last 2 projects I worked on were based on MVC and they were not web sites but were web front end for communication infrastructure. S开发者_运维问答o is it safe to assume that MVC is a golden hammer for, if not all then, most web apps?


It is a good idea for medium to large sized web applications.

But simply following the MVC paradigm does not guarantee good code.


Considering the MVC paradigm was pioneered in the early days of Smalltalk, and now finally being adopted by web applications, I would have to say yes. Until they come up with a better wheel that is.


It reminds me of using <table> for all web page layout, not just specifically tabular data. The proper alternatives need to become more fashionable and step up their marketing.


Well, it is not MVC, but rather modularity and separation of concerns which are the golden hammers for any complex application (whether web or otherwise). Since web applications usually involve client-server communications, interactive user interfaces, and need to provide provisions for routing and caching, developing web applications in modular fashion with loosely coupled layers invariably boils down to separating the presentational layer from actual logic, separating out the actual urls followed from buisness logic and abstracting away the domain logic in separate model classes. Following the MVC architecture simply feels natural from organizational and management point of view because it fits well with the way web applications behave and are understood.

So yes, MVC is a golden hammer for web apps. It is particularly so since MVC is not very strictly defined organizational system and can be very well moulded as per convenience in different contexts.

As far as PHP implementations are concerned most of them are more or less most of them are derived (to varied extents) from rails and therefore are similar in many aspects.

Konstruct ( http://konstrukt.dk ) is a framework that you might be interested in which does not follow this architecture.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜