Skip to content
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

Refine client factory CTOR logic to prevent potential breaking change #1488

Closed
tadelesh opened this issue Jan 22, 2025 · 0 comments · Fixed by #1496
Closed

Refine client factory CTOR logic to prevent potential breaking change #1488

tadelesh opened this issue Jan 22, 2025 · 0 comments · Fixed by #1496
Assignees
Milestone

Comments

@tadelesh
Copy link
Member

We encountered one potential SDK breaking change in this spec change.
It is about client factory CTOR. This PR introduced a new client into the service, and this new client has a new client level parameter compared with previous clients.
Our current logic for client factory is to gather all client level parameters and put them into the client factory CTOR, thus cause the breaking change of adding a new required parameter: subscriptionID.

func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) {
...
}

My proposal is only gathering client parameters that is used by all clients, and put the extra required parameters into to ClientFactory.NewXXXClient method.

func NewClientFactory(credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) {
...
}

func (c *ClientFactory) NewGroupQuotaSubscriptionAllocationRequestClient(subscriptionID string) *GroupQuotaSubscriptionAllocationRequestClient {
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants