Spring 之java实现(extends)多继承
在java本身是不存在多继承机制,但是如何实现多继承呢?
Spring 中ApplicationContext解决方案?(org.springframework.context.ApplicationContext)
?public interface ListableBeanFactory extends BeanFactory {...}
?public interface HierarchicalBeanFactory extends BeanFactory {...}
?public interface MessageSource {...}
?public interface ApplicationEventPublisher {...}
?public interface ResourcePatternResolver extends ResourceLoader {...}
?
?
?public interface ApplicationContext extends ListableBeanFactory, HierarchicalBeanFactory,
??MessageSource, ApplicationEventPublisher, ResourcePatternResolver {...}
?
?
整体思路:定义多个接口(B、C、D...),再定义A接口继承多个接口(B、C、D...),最后实现A接口。