关于spring配置文件的问题。
NaiveWaiter继承Waiter接口
配置文件内容是:
<aop:aspectj-autoproxy />
<bean id="waiter" class="com.baobaotao.NaiveWaiter"/>
<bean class="com.baobaotao.aspectj.aspectj.PreGreetingAspect"/>
测试代码是:
String configPath="com/baobaotao/aspectj/aspectj/AspectJProxyXML.xml";
ApplicationContext ctx=new ClassPathXmlApplicationContext(configPath);
Waiter temp=(Waiter)ctx.getBean("waiter");
为什么测试代码的第三行一定要返回Waiter类型呢? 为什么不能用NaiveWaiter类型。
而且Waiter类型不是一个接口嘛?