关于3层架构和symfony框架
两者都是基于mvc。
但在3层架构中,存储层是一个单独的层,
而在symfony框架中,数据库(存储)层包含在模型层中。
为什么它们不同?
Both of them are based from mvc.
But in 3-tier architecture,storage layer is a separate layer,
while in symfony framework,database(storage) level is included in model layer.
Why are they different?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想说 MVC 专注于用户交互。 它描述了如何开发一个丰富且灵活的系统来响应用户请求,但没有提及控制器层下面发生的事情。
它只是说:
与许多其他层一样,CakePHP 也将模型和数据层粘合在一起。 这只是一个选择:这样您就可以减少层数和代码,但如果您改变主意,则必须直接在模型中修改所有代码。
I would say that MVC is focused on user-interaction. It describes how to develop a rich and flexible system that reacts to user requests, but says nothing about what happens below controller layer.
It just says:
CakePHP also has model and data layer glued together, as many others. It's just a choice: this way you have less layers and less code, but in case you change your mind you'll have to modify all your code, directly in the models.