Skip to content

Instantly share code, notes, and snippets.

@nuitsjp
Created August 12, 2016 06:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nuitsjp/bd11cce6f3a1ce3d84428e1325b719d1 to your computer and use it in GitHub Desktop.
Save nuitsjp/bd11cce6f3a1ce3d84428e1325b719d1 to your computer and use it in GitHub Desktop.
コラム01:PrismとDIコンテナ 02.密結合
public class HatPepper
{
public IList<Shop> SearchShops()
{
IGeolocationService geolocationService = new GeolocationService();
var location = geolocationService.GetCurrentLocation();
// 以降、取得した位置情報から周辺の店舗を取得して返却する
}
}
public interface IGeolocationService
{
Location GetCurrentLocation();
}
public class GeolocationService : IGeolocationService
{
public Location GetCurrentLocation()
{
// 現在の位置情報を返却する
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment