コード例 #1
0
 public WeatherFacade(ConverterService converterService,
                      GeoLookupService geoLookUpService,
                      WeatherService weatherService)
 {
     _converterService = converterService;
     _geoLookUpService = geoLookUpService;
     _weatherService   = weatherService;
 }
コード例 #2
0
 public WeatherReportFacade(TemperatureTypeConverterService converterService,
                            GeoLookupService geoLookUpService,
                            WeatherReportService weatherService)
 {
     _converterService = converterService;
     _geoLookUpService = geoLookUpService;
     _weatherService   = weatherService;
 }
コード例 #3
0
        static void Main(string[] args)
        {
            const string zipCode = "98074";

            // call to service 1
            GeoLookupService geoLookupService = new GeoLookupService();
            City             city             = geoLookupService.GetCityForZipCode(zipCode);
            State            state            = geoLookupService.GetStateForZipCode(zipCode);

            // call to service 2
            WeatherService weatherService = new WeatherService();
            int            fahrenheit     = weatherService.GetTempFahrenheit(city, state);

            // call to service 3
            ConverterService metricConverter = new ConverterService();
            int celcius = metricConverter.ConvertFahrenheitToCelcious(fahrenheit);

            // bring the result of all service calls together
            Console.WriteLine("The current temperature is {0} F / {1} C in {2}, {3}",
                              fahrenheit,
                              celcius,
                              city.Name,
                              state.Name);
        }
コード例 #4
0
 public TemperatureLookupFacade(WeatherService weatherService, GeoLookupService geoLookupService, EnglishMetricConverter englishMetricConverter)
 {
     this.weatherService   = weatherService;
     this.geoLookupService = geoLookupService;
     this.converter        = englishMetricConverter;
 }
コード例 #5
0
 public TemperatureLookupFacade(WeatherService WeatherService, GeoLookupService GeoLookupService, EnglishMetricConverter EnglishMetricConverter)
 {
     _WeatherService         = WeatherService;
     _GeoLookupService       = GeoLookupService;
     _EnglishMetricConverter = EnglishMetricConverter;
 }
コード例 #6
0
 public TemperatureLookupFacade()
 {
     _WeatherService         = new WeatherService();
     _GeoLookupService       = new GeoLookupService();
     _EnglishMetricConverter = new EnglishMetricConverter();
 }