120 likes | 206 Views
Wrapping a Weather Module into a CHAIMS MegaModule. Mike Laskin Tools and Process for Software Stanford University - CS 446 - Fall 1998 December 2, 1998. Wrap a weather service so it can be used as a CHAIMS-compliant megamodule - Simple, Right?. Which weather service?
E N D
Wrapping a Weather Module into a CHAIMS MegaModule Mike LaskinTools and Process for SoftwareStanford University - CS 446 - Fall 1998December 2, 1998
Wrap a weather service so it can be used as a CHAIMS-compliant megamodule - Simple, Right? • Which weather service? • Interface: CHAIMS <=> Weather Service • Wrapping a MegaModule • Testing
Typical Scenario A general has to ship troops and/or various material from San Diego NOSC to Washington DC: • different kind of material: criteria for preferred transport differ • not every airport equally suited • congestion, prices • actual weather • certain due or ready dates
Typical Scenario (cont.) • Today: • calling different companies • looking up information on the web • reservations by hand • Tomorrow • system proposes possibilities that take into account various conditions
Weather Data over TCP/IP • http://www.wunderground.com/ • http://cirrus.sprl.umich.edu/wxnet/ • Colorado Weather UndergroundContel DUAT SystemCornell University Weather & Climate Data NCDC Hurricane SystemNOAA Master DirectorySouthern Regional Climate Center...
Weather Data Types • GeoLocation: City / Airport abbreviation / State / lattitude & longitude • Conditions • Min/Max/Avg Temperature in °F and °C • Cloud Cover level • Wind speed, direction
Weather Data API • WeatherToday(GeoLocation) • 5DayWeather (GeoLocation) • ClosestWeather(Conditions) • Weather(City, Day) • 5DayWeatherFrom(City, Day)
Megamodule Provider Megaprogrammer wraps non-CHAIMS compliant megamodules` writes information Wrapper Templates Megaprogram (in CHAIMS language) information CHAIMS Compiler b d generates e a CSRT(compiled megaprogram) c MEGA modules Distribution System (CORBA, RMI…) Architecture: Overview adds information to CHAIMS Repository
Megaprogram Example: Code // Setup connections to megamodules. // Get information from // megaprogram user // about the city. // Get the weather for the // next day // Terminate all // invocations weather_mmh = SETUP (”Weather") route_mmh = SETUP ("RouteInfo") ... dayweather_ih = weather_mmh.INVOKE (”WeatherToday”, city = “Palo Alto, CA”) WHILE (dayweather_ih.EXAMINE() != DONE) {} outweather = dayweather_ih.EXTRACT() ... weather_mmh.TERMINATE()
In Closing • CHAIMS is a viable architecture • The weather service can be implemented In the future: • Will finish the weather service implementation • Updated documentation for CHAIMS would be of great help