How can I make Spring identify beans without using xml or annotations?

The Component scanning behaviour of context:component-scan is only the default. You can customize its behaviour using name-based filters. See section 3.10.3 of the manual for an example.

The @Component-scanning behaviour of is only the default. You can customize its behaviour using name-based filters. See section 3.10.3 of the manual for an example: So you can make it detect your beans by the naming convention of the classes.

1, didn't know that :) – Bozho Mar 21 at 14:51 1 @Bozho: Neither did I :) – skaffman Mar 21 at 15:07.

The 3rd option is using the @Configuration and @Bean Annotations and using the Java-based container configuration. But then you are writing code to wire your dependencies together and create your beans.

Thank you, this seems to be a very interesting option. – Mehdi Mar 21 at 13:57.

Out of all the objects in your system only a small subset really need to be wired: those that are configurable and those that have dependencies on other wired beans.

You're right, but even if I try to narrow down the number by figure out what are the beans that need to be wired, the number will still be huge (i'm dealing with an enterprise application) – Mehdi Mar 21 at 14:00.

Agree with Bozho. There is a workaround - you can define your own custom BeanFactoryPostProcessor, where you can put the logic for scanning through the classes in your existing project based on your naming conventions and registering the BeanDefinitions for the classes in your existing project. Yes, this requires coding though and is not something that you get out of the box.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions