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

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.

主站蜘蛛池模板: 清徐县| 花莲市| 延安市| 闽清县| 衡南县| 洪湖市| 长泰县| 西丰县| 乌海市| 游戏| 扎囊县| 大埔区| 泸定县| 临桂县| 定安县| 肇州县| 马龙县| 内黄县| 横山县| 宁武县| 宽城| 泰宁县| 西安市| 师宗县| 吴江市| 阜南县| 南宫市| 祥云县| 南康市| 赫章县| 板桥市| 左云县| 抚远县| 宝山区| 乐陵市| 金堂县| 宝坻区| 敖汉旗| 淮安市| 平山县| 临安市|