anchor.diff:  ----
   
   Otherwise, bean names will match the method names. (This works in the same way as does Spring's Java configuration.)
  -    
  +
   If you have more than one service of a type bound to the application or want explicit control over the services to which a bean is bound, you can pass the service names to methods such as `dataSource()` and `mongoDbFactory()`.
  -    
  +
   [source,java]
   ----
   class CloudConfig extends AbstractCloudConfig {
  
positive.code: 
  [TIP]
  ====
  If you are migrating an application that uses link:https://spring.io/blog/2011/11/04/using-cloud-foundry-services-with-spring-part-2-auto-reconfiguration/[auto-reconfiguration], you might first try the <<_scanning_for_services,service-scanning approach>> until you need more explicit control.
  ====
  
  The Spring Service Connector Java configuration also offers a way to expose application and service properties in case you want lower-level access when creating your own service connectors (or for debugging purposes, etc.).  
  
  === Creating Service Beans
  
  The configuration shown in the following example creates a `DataSource` bean that connects to the only relational database service bound to the application (it will fail if there is no such unique service).  It also creates a `MongoDbFactory` bean, which again connects to the only MongoDB service bound to the application. (For ways to connect to other services, see the link:http://docs.spring.io/autorepo/docs/spring-cloud/current/api/org/springframework/cloud/config/java/AbstractCloudConfig.html[Javadoc for `AbstractCloudConfig`].)
  
  [source,java]
  ----
  
negative.code:         public DataSource inventoryDataSource() {
              return connectionFactory().dataSource();
          }
  
      @Bean
      public MongoDbFactory documentMongoDbFactory() {
          return connectionFactory().mongoDbFactory();
      }
  
      // (More beans to obtain service connectors)
  }
  ----
  