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

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.

主站蜘蛛池模板: 灵宝市| 宾川县| 溧阳市| 吉隆县| 甘洛县| 咸阳市| 织金县| 平舆县| 永春县| 芷江| 巴塘县| 温州市| 资兴市| 津市市| 措美县| 南岸区| 英吉沙县| 图木舒克市| 鄂托克前旗| 衡山县| 讷河市| 阆中市| 巴青县| 桃园市| 革吉县| 商都县| 霞浦县| 二手房| 运城市| 闵行区| 乌兰察布市| 涟水县| 枣庄市| 微山县| 临海市| 闽清县| 唐山市| 土默特左旗| 伊吾县| 林西县| 台中市|