Issue 18: Instantiate interfaces and abstract classes in Spring container
Project Member Reported by kuisong....@gmail.com, Mar 16, 2010
Because of aop, methods in them are able to be implemented by intercepts. So 
that it would be quite useful to instantiate interfaces or abstract classes 
which some or all methods implemented by AOP in IOC Container. However, interfaces and abstract classes cannot be instantiated directly in Spring due 
to their abstract personality. 

The requirement of this enhancement is interfaces or abstract classes are 
able to be value of "class" element in "bean" configuration of Spring, and 
for supporting annotation, the instantiation also are detected by component 
scanner in Spring.
Mar 16, 2010
Project Member #2 kuisong....@gmail.com
Fortunately, spring supports 
[http://static.springsource.org/spring/docs/3.0.x/spring-framework-
reference/html/beans.html#beans-factory-method-injection Method Injection] to 
replace abstract method implementation in abstract classes, which means extending 
that to add method overrides for all interfaces and abstract classes automatically is 
able to instantiate them in Spring bean factory. 

A implementation of [http://static.springsource.org/spring/docs/3.0.x/javadoc-
api/org/springframework/beans/factory/config/BeanFactoryPostProcessor.html BeanFacto
ryPostProcessor] is a excellent way to do that. Please refer to 
[https://code.google.com/p/polyforms/source/browse/di/src/main/java/org/polyforms/di/s
pring/schema/AbstractMethodOv
errideProcessor.java AbstractMethodOverrideProcessor] for detail.
Mar 16, 2010
Project Member #3 kuisong....@gmail.com
For component scanning in Spring, because it is hard code in 
[http://static.springsource.org/spring/docs/3.0.x/javadoc-
api/org/springframework/context/annotation/ClassPathBeanDefinitionScanner.html 
ClassPathBeanDefinitionScanner] that interfaces and abstract classes cannot be 
instantiated, and also ClassPathBeanDefinitionScanner cannot be replaced directly in 
"component-scan" due to new operation of ClassPathBeanDefinitionScanner in 
[http://static.springsource.org/spring/docs/3.0.x/javadoc-
api/org/springframework/context/annotation/ComponentScanBeanDefinitionParser.html 
ComponentScanBeanDefinitionParser]. Therefore, we have to define schema to override 
default implementation to allow interfaces and abstract classes to pass the filter. 
For detail please refer to 
[https://code.google.com/p/polyforms/source/browse/di/src/main/java/org/polyforms/di/s
pring/schema/PolyformsComponentScanBeanDefinitionParser.java 
PolyformsComponentScanBeanDefinitionParser].
Mar 16, 2010
Project Member #4 kuisong....@gmail.com
(No comment was entered for this change.)
Status: Started
Mar 16, 2010
Project Member #5 kuisong....@gmail.com
(No comment was entered for this change.)
Labels: -Dependency-Injection Module-DI
Mar 18, 2010
Project Member #6 kuisong....@gmail.com
add a Method Replacer which throws UnsupportedOperationException as a default implementation of abstract 
methods in interfaces or abstract classes to inform developer adding intercept for these methods
Mar 18, 2010
Project Member #7 kuisong....@gmail.com
Implemented with unit test
Status: Fixed