Created
August 12, 2016 06:32
-
-
Save nuitsjp/bd11cce6f3a1ce3d84428e1325b719d1 to your computer and use it in GitHub Desktop.
コラム01:PrismとDIコンテナ 02.密結合
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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