依赖注入让您将应用程序的主要层次编织到一起,从而,这使您产生一个具有视图、模型和控制器层的松散耦合应用程序。
Dependency injection lets you weave together the main layers of your application, which, in turn, lets you produce a loosely coupled application with view, model, and controller layers.
同样地,您在控制器中为应用程序添加的目的地和其他控制代码;您不在您的模型中放入这些数据。
Likewise, the controller is where you add destinations and other controlling code for your application; you don't put any of that stuff in your model.
用这种方式使用观察者,可以让控制器与模型分离,让模型与视图分离,从而简化gui应用程序的开发。
The use of Observer in this way lets the controller be separated from the model, and the model be separated from the view, simplifying the development of GUI applications.
应用推荐