When using aspectj, why use @Component over @Configurable.
I've got spring and aspectj setup for @Transactional support, aspects on self-invocation, and injection into JPA entities. This works great.
I'm using @Component for most classes that need injection, and thus either having them injected into their dependencies. Or, when I can't, injecting the ApplicationContext and then using getBean() as a last resort. And I'm reserving @Configurable for only JPA entities (hibernate) that need injection. I've also started using @Configurable for jUnit tests, to make writing tests easy. This also works great.
But I'm curious. If aspectj is now auto-injecting (beanifying) anything with the @Configurable annotation, regardless of how its constructed; getBean(), new(), @Autowired. Why wouldn't I just switch to using @Configurable for all my beans? Then I can do away with the application context and getBean() altogether, and just new() any classes I can't inject.
I realize that I made no mention of xml bean configuration. I don't shy away from that, but this project doesn't happen to require any. I just constructor or setter inject the dependencies when testing. very easy.