我从这里读到:
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/