4.4. ConfigurationSupport
Prev | 4. Modularizing configurations | Next

## 4.4. `ConfigurationSupport`

As a convenience, `@Configuration` classses may extend `ConfigurationSupport`, primarily in order to facilitate easy lookup of beans from the enclosing `ApplicationContext`.

    @Configuration
    public class AppConfig extends ConfigurationSupport {
        @Bean
        public Service serviceA() {
             // referencing a bean of type DataSource declared elsewhere
            DataSource dataSource = this.getBean(DataSource.class);
            return new ServiceImpl(dataSource);
        }
    }

Prev | Up | Next
4.3. Aggregating @Configuration classes with @Import | Home | 5. Working with externalized values