-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Service Bus] Change getter of boolean values to isXyz() #15890
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
The changes in this PR are not necessarily applicable only to Java. The other languages we are working on for Service Bus should be considered as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My conclusions after multiple discussions on this subject:
We are not too keen on being consistent between the "Enable" and "Requires" prefixes as matching with what goes over the wire trumps the small win of being consistent with the prefixes. This would not hold true for cases where the name is way too bad in the first place, but we do not find any such instances for Service Bus at the moment.
Unlike other languages, Java has getters and setters with get/set prefixes. For boolean return types, is is preferred instead of get. Since most of the properties do not read well if we just added is prefix, we will be taking the liberty to reword the names of these properties to help with readability. These will not match exactly with what goes over the wire, but will have similar words, so that should not be a problem. The win to readability trumps for Java due to the necessity to have separate prefixes for the getters and setters.
My mistake was to assume that the efforts in this PR also included in improving names in general and so would affect other languages.
Having said this, @JonathanGiles and I noticed that we are not updating the setters in this PR. One would expect the setter and getter names to differ only in the prefix i.e. is vs set. Can we have the setters updated here as well?
boolean getters and setters suggestion.
|
It's customary to use isXyz() for a boolean value getter than getXyz(), as suggested in issue #14139 . So This PR suggests the following and other similar changes to the public APIs.
enableBatchedOperations() -> isBatchedOperationsEnabled()
enablePartitioning() -> isPartitioningEnabled()
deadLetteringOnMessageExpiration -> isDeadLetteringOnMessageExpiration()
requiresDuplicateDetection() -> isDuplicateDetectionRequired()
supportsOrdering() -> isOrderingSupported()
ServiceBusAdministrationClient
hasgetQueueExists(String queueName)
and other similar methods. This get method name kept because it implies an HTTP get operation. .Net calls itQueueExists
.Closes #14139