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

Resolve Attestation Factory Method vs Factory Class dispute. #3584

Closed
LarryOsterman opened this issue Apr 22, 2022 · 1 comment
Closed

Resolve Attestation Factory Method vs Factory Class dispute. #3584

LarryOsterman opened this issue Apr 22, 2022 · 1 comment
Assignees
Labels
Attestation Client This issue points to a problem in the data-plane of the library. design-discussion An area of design currently under discussion and open to team and community feedback.

Comments

@LarryOsterman
Copy link
Member

@vhvb1989 points out that factory methods have some functional drawbacks, there is an outstanding discussion with the API review team about the best solution.

THis bug tracks fixing this, and it MUST be fixed before the Attestation SDK GA's.

The not-so-good about factory methods is that they are accessible from class instances as well.
So, you attestation client will also list the client.Create() method just like the class AttestationClient::Create().

What I usually prefer is to create the factory as an additional class with no constructor (real factory). Something like AttestationClientFactory.

Originally posted by @vhvb1989 in #3543 (comment)

@ghost ghost added the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Apr 22, 2022
@LarryOsterman LarryOsterman self-assigned this Apr 22, 2022
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Apr 22, 2022
@RickWinter RickWinter added Client This issue points to a problem in the data-plane of the library. design-discussion An area of design currently under discussion and open to team and community feedback. labels Apr 24, 2022
@LarryOsterman
Copy link
Member Author

Because the intellisense experience for factory classes is better than the experience for factory methods, settled on a factory class.

Also created Azure/azure-sdk#4349 to add guideline documentation on this pattern.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Attestation Client This issue points to a problem in the data-plane of the library. design-discussion An area of design currently under discussion and open to team and community feedback.
Projects
None yet
Development

No branches or pull requests

2 participants