ctubbsii commented on issue #747: Shorten method names in AccumuloClient builder
URL: https://github.com/apache/accumulo/issues/747#issuecomment-436037637
 
 
   I'd like to see the authentication options split up a bit to avoid the 
`(String, String)` (or `CharSequence` variants) parameter ambiguity and the 
redundancy in the user principal. Something like:
   
   ```java
     // one of these two
     .user(CharSequence principal)
     .as(CharSequence principal)
       // followed by one of these three
       .token(AuthenticationToken token)
       .password(CharSequence password)
       .keytab(Path keytab)
   ```
   
   I'd also like to see fewer `String` arguments when `Path` or `File` make 
more sense. For example,
   
   ```java
     .from(Path propertiesFilePath)
   ```
   
   and in the `instance`. However, I'm uncertain what to do for instance. I 
think `instance` could refer to the instance name as a "cluster id" or similar. 
Maybe something like:
   
   ```java
     Accumulo.newClient().toCluster(CharSequence 
name).registeredAt(CharSequence... host);
   ```
   
   Names for the client endpoint are hard. Maybe the term "endpoint" could be 
worked in to the method name instead? I'm not sure.
   
   I lean towards keeping the `with` prefixes. Those keep it the API closer to 
natural human language (maps to prepositional phrases), which is important for 
fluent APIs, and I think it would be inconsistent to drop those, but leave the 
`from` prepositional phrases.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to