Skip to content

Instantly share code, notes, and snippets.

@beyondxscratch
Last active July 27, 2019 22:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save beyondxscratch/c3342ffd5dc5b3fee3f1beda87ec7638 to your computer and use it in GitHub Desktop.
Save beyondxscratch/c3342ffd5dc5b3fee3f1beda87ec7638 to your computer and use it in GitHub Desktop.
Example of a boilerplate bean factory
@Configuration
public class DomainConfiguration {
@Bean
public RetrieveSanitaryGrades retrieveSanitaryGrades() {
return new RetrieveSanitaryGrades();
}
@Bean
public SearchRestaurants restaurantsFinder(Restaurants restaurants,
OpeningHours openingHours,
RetrieveSanitaryGrades retrieveSanitaryGrades) {
return new RestaurantsFinder(restaurants, openingHours, retrieveSanitaryGrades);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment