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

[FormRecognizer] Consider adding parameterless protected constructors to Operation types #12401

Closed
kinelski opened this issue Jun 1, 2020 · 0 comments · Fixed by #18890
Closed
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. Cognitive - Form Recognizer Cognitive Services
Milestone

Comments

@kinelski
Copy link
Member

kinelski commented Jun 1, 2020

Regarding our mocking guidelines: https://azure.github.io/azure-sdk/dotnet_introduction.html#dotnet-mocking

DO provide protected parameterless constructor for mocking.
DO provide factory or builder for constructing model graphs returned from virtual service methods.

The last point suggests that we create a factory for models because "model types shouldn’t have public constructors". This doesn't apply to Operation types, since they have a public constructor to access an existing LRO.

We're wondering whether we should include a parameterless protected constructor in Operations as well. It seems Storage is doing so (in Storage Blobs, at least), but Key Vault isn't, so I feel like our guidelines are not very specific on this matter. It would be great to update our guidelines to be more explicit about that, and decide on a preferred approach, if possible.

There's currently an open discussion about that in the .NET language channel.

@kinelski kinelski added Cognitive Services Client This issue points to a problem in the data-plane of the library. FormRecognizer labels Jun 1, 2020
@kinelski kinelski added this to the Backlog milestone Jun 1, 2020
@AlexGhiondea AlexGhiondea modified the milestones: Backlog, [2020] July Jun 3, 2020
@maririos maririos modified the milestones: [2020] September, Backlog Aug 12, 2020
@kinelski kinelski modified the milestones: Backlog, [2021] March Feb 19, 2021
@kinelski kinelski self-assigned this Feb 22, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Mar 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. Cognitive - Form Recognizer Cognitive Services
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants