nExample with DI
npublic class WeatherServiceImpl implements WeatherService {
n
private WeatherDao weatherDao;
n
public void setWeatherDao (WeatherDao weatherDao) {
n
this.weatherDao = weatherDao;
n }
n}
nXML descriptor file
n<bean id="weatherService" class="swe645.ioc.WeatherServiceImpl">
n
<property name="weatherDao">
n
<ref local="weatherDao"/>
n
</property>
n</bean>
n<bean id="weatherDao"
n
class="swe645.ioc.StaticDataWeatherDaoImpl">
n</bean>
n