Azure / azure-storage-android

Microsoft Azure Storage Library for Android
Apache License 2.0
81 stars 47 forks source link

ListTables method not consistent with ListQueues and ListContainers #25

Closed ChrisRisner closed 8 years ago

ChrisRisner commented 8 years ago

The CloudTableClient has a method named listTables which returns an Iterable where the CloudBlobClient's listContainers method returns an Iterable and the CloudQueueClient's listQueues method returns an Iterable.

emgerner-msft commented 8 years ago

Maybe I'm just confused... from what you're saying above (and in the code) they all return an Iterable. How is this inconsistent?

ChrisRisner commented 8 years ago

Sorry, I didn't realize that the code was removed from the comment. Here are the return types: Iterable<CloudBlobContainer> listContainers Iterable<CloudQueues> listQueues Iterable<String> listTables

So the first two return objects with additional details (i.e. URI) where tables only returns the table name.

emgerner-msft commented 8 years ago

Ah, that's intentional. :) I realize it's not perfect, but here's why: for containers and queues there's additional metadata and properties that can be associated with the objects and which get returned by list. For tables, there's nothing -- no metadata, no properties. So, all that's actually ever returned is the table name. We could make a table object, but based on experience a lot of folks don't want the object and will just end up calling getName. Constructing the table object with the name is easy -- you just do client.getTableReference(tableName). So, we add the burden only for folks who actually want the object.

Summary: Container and queue need to full object to represent additional return values. Table does not.

ChrisRisner commented 8 years ago

Thanks for the explanation!