gpt4 book ai didi

asp.net-mvc - Controller 或型号 : who should implement business methods in MVC?

转载 作者:行者123 更新时间:2023-12-01 08:18:27 27 4
gpt4 key购买 nike

我从这里读到:

http://www.dotnetjohn.com/articles.aspx?articleid=287

the Controller represents the application's business logic. The Model is that component that maintains the state of the entities.



但是,如果我阅读了 MVC 原始论文,我认为这不是一回事:
http://heim.ifi.uio.no/~trygver/1979/mvc-2/1979-12-MVC.pdf

据我所知, Controller 就像一个交通警察,模型因为它代表知识应该实现业务方法。

你有什么看法?

最佳答案

恕我直言,它是应该实现 Controller 使用的业务方法的模型。对我来说,模型是一组业务对象和服务方法,它们表示对这些对象的操作。 MVC 只是一种模式。例如,如果明天你决定改变模式并使用其他东西,继续,没问题,但你不应该改变你的商业模式,它们是一切的核心。

关于asp.net-mvc - Controller 或型号 : who should implement business methods in MVC?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4418482/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com