April 05
Prof. Ismael H. F. Santos -  ismael@tecgraf.puc-rio.br                                                          2
Example-2b (cont.)
nClient (Stand-alone)
n  ApplicationContext ctx = new   
n                ClassPathXmlApplicationContext(
                       "ioc/applicationContext.xml");
n   WeatherService ws = (WeatherService)ctx.getBean(
n                         "weatherService");
n   Double high = ws.getHistoricalHigh(new 
n                  GregorianCalendar(2004, 0,1).getTime());
n   System.out.println("High was test: " + high);
nDI
1.Load context
2.Instantiates beans
3.Configures simple properties
4.Resolves dependencies