Using the dependency locator
When we design a loosely coupled architecture, which nowadays is a standard practice to separate concerns between our layers, we program against interfaces and not implementations.
The problem we're solving with abstractions is tight coupling, which is when implementation layers are reference one each other directly; for example, the view has a reference of the presentation layer, which in turn has a repository reference that has a service reference class, meaning that the view is coupled to the service layer at the bottom.
To achieve loose coupling, we somehow need to tell the project in runtime that for the interface we are programming against to create this implementation class.
There are three ways to achieve this: ...
Get Xamarin: Cross-Platform Mobile Application Development now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.