Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Reconsider use of _*_args methods in public service_bus methods #21

Closed
guangyang opened this issue Apr 6, 2013 · 3 comments
Closed

Comments

@guangyang
Copy link
Contributor

The service_code has several public methods that take a single *p parameter, to allow overloading parameters:

  • _rule_args takes (topic_name, subscription_name, rule_name) as strings, or (rule) a object with those properties, and an options instance.
  • _subscription_args takes (topic_name, subscription_name) as strings, or (subscription) a object with those properties, and an options instance.

This is convenient in some circumstances, but I worry about how it is inconsistent. I would expect one of the following:

  1. All methods take a fixed list of parameters, with no overloads.
  2. All methods that take parts of existing classes as inputs also take those classes as inputs in place of the individual parts.

Currently, we have a mix, at least 90% in case 1, and just a few in case 2. This makes it hard to reason about how to use the API.

Suggestions, in order of my preference:

  1. Remove the overloads for Service Bus methods, for consistency.with the rest of the Blob, Queue, and Table APIs. After shipping, we can figure out how to consistently add overloads.
  2. Leave as is.
  3. Add overloads everywhere now, before shipping. (But this is crazy.)
@guangyang
Copy link
Contributor Author

For example, you could overload the deleteMessage and unlockMessage to accept a message in addition (queue, sequence_number, lock_token) / (topic, subscription, sequence _number, lock_token)

@guangyang
Copy link
Contributor Author

And could also reasonably overload peek_lock_message and read_delete_message.

@andrerod
Copy link

Closing due to bug scrub. Please reopen if applicable.

@azuresdkci azuresdkci removed this from the backlog milestone Sep 21, 2014
@azuresdkci azuresdkci removed the P2 label Sep 21, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants