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

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.

主站蜘蛛池模板: 通河县| 济阳县| 灵台县| 浑源县| 饶平县| 木兰县| 枣庄市| 石河子市| 丰城市| 体育| 长宁县| 宁国市| 江门市| 札达县| 龙井市| 当雄县| 青田县| 惠东县| 襄城县| 鹤庆县| 黑山县| 柘荣县| 天等县| 裕民县| 合山市| 乃东县| 江口县| 吉木萨尔县| 吴江市| 福鼎市| 宁波市| 曲沃县| 崇礼县| 山阳县| 福安市| 民丰县| 五指山市| 樟树市| 贵南县| 华蓥市| 松江区|