Update method names for client registrations#2630
Conversation
playground/AzureSearchEndToEnd/AzureSearch.ApiService/Program.cs
Outdated
Show resolved
Hide resolved
|
Do we want to add new ones and deprecate the old ones? |
So ship a preview (at least) with deprecations, to provide a hint about how to update existing apps? I like it. |
Yep. |
Make sure we log an issue in the correct milestone to remove these deprecated methods. We don't want to ship GA with them. |
a6523a9 to
ce6bc28
Compare
|
I pushed a brand new set of changes with the feedback I got. Now it keeps the same prefixes as before with the added "Client" suffix when necessary. And the existing one is marked as [Obsolete]. |
| builder.AddAzureBlobServiceClient("blob"); | ||
| builder.AddAzureTableServiceClient("table"); | ||
| builder.AddAzureQueueServiceClient("queue"); |
There was a problem hiding this comment.
What do folks think about shortening these?
| builder.AddAzureBlobServiceClient("blob"); | |
| builder.AddAzureTableServiceClient("table"); | |
| builder.AddAzureQueueServiceClient("queue"); | |
| builder.AddAzureBlobsClient("blob"); | |
| builder.AddAzureTablesClient("table"); | |
| builder.AddAzureQueuesClient("queue"); |
There was a problem hiding this comment.
The underlying class names are:
Azure.Storage.Blobs.BlobServiceClientAzure.Data.Tables.TableServiceClientAzure.Storage.Queues.QueueServiceClient
Is it confusing if we drop "Service" from these names? In general I like to stick with the naming of the underlying thing. But agree that @DamianEdwards's suggestion looks cleaner.
There was a problem hiding this comment.
Keep the underlying names, that way we don't need to think too much 😄
There was a problem hiding this comment.
FWIW we're adding Client to all the methods which happens to match the underlying types in this case but not all cases.
There was a problem hiding this comment.
I won’t die on this hill but we should optimize for less case by case naming conventions.
I could go with either.
There was a problem hiding this comment.
I think we should aim to go with something generic like Add[LogicalName]Client, e.g. AddRedisClient, AddAzureBlobsClient, AddSqlClient, etc. (obvious exception for EF Core related methods that operate on a DbContext).
There was a problem hiding this comment.
Lets close then.
Is that "Just do it"?
There was a problem hiding this comment.
Done, also changed AddAzureKeyVaultSecretsClient
# Conflicts: # playground/cdk/CdkSample.ApiService/Program.cs
Fixes #1510
We may consider different names based on taste. Sometimes the name matches the client type, and sometimes not.
Examples:
AddRabbitMQClient(), maybe remove theMQ. The client name isIConnection.AddRedisClient(), the client name isIConnectionMultiplexer, I think it's ok.AddCosmosClient(), the client name isCosmosClientbut might sound better withAddCosmosDBClient.Microsoft Reviewers: Open in CodeFlow