官术网_书友最值得收藏!

Inversion of Control 

IoC is a design principle in which the responsibility of selecting concrete implementations for dependencies of a class is delegated to an external component or source. This way, the classes are decoupled from their dependencies so that they can be replaced/updated without much hassle.

The most common implementation of this principle is using the service locator pattern, where a container is created to store the concrete implementations, often registered via an appropriate abstraction, as shown in the following diagram: 

Xamarin.Forms offers DependencyService, which can be especially helpful when you're creating platform-specific implementations for platform-agnostic requirements. We must also remember that it should only be used in Xamarin.Forms platform projects; otherwise, we would be creating an unnecessary dependency on Xamarin.Forms libraries.

主站蜘蛛池模板: 嘉定区| 阳朔县| 宝应县| 无锡市| 临高县| 铁岭县| 云南省| 咸宁市| 贡觉县| 新平| 贵溪市| 景洪市| 大名县| 莒南县| 温泉县| 香河县| 浦东新区| 东阿县| 岑巩县| 开远市| 龙岩市| 茶陵县| 田林县| 城固县| 酉阳| 朝阳区| 广宗县| 屯门区| 台南县| 兴义市| 阳山县| 文登市| 房山区| 凤翔县| 武定县| 读书| 渝北区| 嵊泗县| 玉田县| 靖边县| 嘉善县|