Moving from Guice to Spring: beans with default constructor and properties handling
<p>I just have finished moving my pet project from Guice to Spring DI. I want to share some notes and ask for advice. 
Guice config was done with annotations (the only possible way), and Spring config is also only with annotations: one AppConfig class annotated with @Configuration and a plenty of bean creation methods annotated with @Bean inside.</p>

<p>Observations and questions:</p>

<ol>
<li><p>Spring's configuration is full of methods that create beans with
default no-args constructor:</p>

<blockquote>
<pre><code>@Bean
public DataProvider getDataProvider() {
    return new DataProvider();
}
</code></pre>
</blockquote>

<p>Thats definitely bad. Guice instantiates beans with default
constructor without any additional configuration. Can I do this in
Spring? I know that if I add @Component annotation along with
classpath scanning annotation it will do the trick. But: 1.
injecting with @Component is different from injecting with @Bean 2.
I need to scatter my configuration among even more files than while
just adding @Autowired. Thats bad. The only solution to keep all
configs in one place is old good XML configuration, but again with
explicit declaration of all beans.  Or I am wrong and this can be
done better in Spring?</p></li>
<li>Properties files handling. While working with Guice I did a bad thing: I have scattered @Named annotation along huge number of private fields where property values were injected. Sometimes there were 5 properties to be injected in some class - and this resulted in 5 annotations. That was not a good solution.I tried to do better with Spring, but the only thing I have found is instantiating and injecting Configuration files everywhere. Just take a look of this perfection:

<blockquote>
<pre><code>@Bean
public MyProjectStorageConfiguration getStorageConfiguration(
        @Value("${mongo.collections.names})") String mongoNames,
        @Value("${mongo.collections.data})") String mongoData,
        @Value("${files.maindata})") String mainData,
        @Value("${files.secondarydata})") String secondaryData,
        @Value("${files.backupdata})") String backupData,
        @Value("${files.additionaldata})") String additionalData) {
    return new MyProjectStorageConfiguration(mongoNames,mongoData, mainData,secondaryData,backupData,additionalData);
}
</code></pre>
</blockquote></li>
</ol>

<p>Looks like my pet project needs to be refactored again. Any suggestions?</p>