服务定位器模式通过提供一个RIA所需的所有服务的仓库解决这个难题。使用它,你可以集中和重用你的服务标签。
The Service Locator pattern addresses this challenge by providing a repository for all services that the RIA requires. Within it you can centralize and reuse your service tags.
你已经学习服务定位器模式如何可以用于封装,你的富互联网应用程序可以作出的,在一个可预计位置的一个公共类下的,所有不同的服务调用。
You've learned how the service Locator pattern can be used to encapsulate all the different service calls that your rich Internet application might make under a common class in a predictable location.
对于PureMVC用户来说,主要的好处是当遇到依赖时可以使用依赖注入。 同时这也是最大的缺点,因为DI的使用不可避免地会改变一些原始的PureMVC使用习惯,而这些习惯是基于服务定位器模式的。
The main benefit for PureMVC users is a consequence of using the dependency injection pattern when dealing with dependencies.
对于PureMVC用户来说,主要的好处是当遇到依赖时可以使用依赖注入。 同时这也是最大的缺点,因为DI的使用不可避免地会改变一些原始的PureMVC使用习惯,而这些习惯是基于服务定位器模式的。
The main benefit for PureMVC users is a consequence of using the dependency injection pattern when dealing with dependencies.
应用推荐