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

Added comment about virtual methods #3105

Merged
merged 2 commits into from
Sep 22, 2017
Merged

Added comment about virtual methods #3105

merged 2 commits into from
Sep 22, 2017

Conversation

CoolDadTx
Copy link
Contributor

Title

Added comment on virtual methods

Summary

Added comment about using HttpMessageHandler instead of overriding virtual methods when extending the class.

Suggested Reviewers

@davidsh @karelz

Added a line about not overriding virtual methods because of issues involved with it.
@dnfclas
Copy link

dnfclas commented Sep 9, 2017

This seems like a small (but important) contribution, so no Contribution License Agreement is required at this point. We will now review your pull request.
Thanks,
.NET Foundation Pull Request Bot

@karelz
Copy link
Member

karelz commented Sep 9, 2017

cc @Priya91 @geoffkizer @wfurt

Copy link
Contributor

@davidsh davidsh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -25,7 +25,7 @@
## Remarks
The <xref:System.Net.Http.HttpClient> class instance acts as a session to send HTTP requests. An <xref:System.Net.Http.HttpClient> instance is a collection of settings applied to all requests executed by that instance. In addition, every <xref:System.Net.Http.HttpClient> instance uses its own connection pool, isolating its requests from requests executed by other <xref:System.Net.Http.HttpClient> instances.

The <xref:System.Net.Http.HttpClient> also acts as a base class for more specific HTTP clients. An example would be a FacebookHttpClient providing additional methods specific to a Facebook web service (a GetFriends method, for instance).
The <xref:System.Net.Http.HttpClient> also acts as a base class for more specific HTTP clients. An example would be a FacebookHttpClient providing additional methods specific to a Facebook web service (a GetFriends method, for instance). Derived classes should not override the virtual methods on the class. Use the constructor overload accepting <xref:System.Net.Http.HttpMessageHandler> to configure any pre- or post-request processing instead.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Wondering if it would be better to say "Use a constructor overload that accepts" since there's more than one though.

/cc @stevewhims

Copy link
Contributor

@stevewhims stevewhims Sep 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "instead" works well to flow the thought from one sentence to the next, but I'd put the "instead" at the start of the 2nd sentence. Then the reader doesn't need to wait till the end of the sentence to parse that connection. So: "Instead, use a constructor overload that accepts ...".

@JRAlexander JRAlexander added the ✨ 1st-time docs contributor! Indicates PRs from new contributors to the docs repository label Sep 19, 2017
@mairaw
Copy link
Contributor

mairaw commented Sep 22, 2017

Thanks @CoolDadTx for adding this. I've made some minor changes based on the feedback given, so we can merge this PR. I'll wait for the CI build to finish before merging. The fix should go live in our next wave of updates to production in the next day or so.

@mairaw mairaw merged commit 16edd34 into dotnet:master Sep 22, 2017
mairaw added a commit that referenced this pull request Sep 23, 2017
* Typo in document - IOne instead of One (#3202)

Typo in document - IOne instead of One

* Fix framework in dotnet store command topic (#3188)

Reported by @pauliusnorkus. Thanks to @dasMulli for reminding me about the framework problem here. Using `netstandard2.0` worked during pre-release but no more.

* Modified BindingOperations.EnableCollectionSynchronization overloads (#3153)

* Modified BindingOperations.EnableCollectionSynchronization overloads

* Some corrections to last overload

* Incorporated review comments

* Addressed review comments

* Fixed bad xrefs

* 90785 WebClient.Credentials property is cleared on redirect (#3087)

* 90785 WebClient.Credentials property is cleared on redirect

* Removing "or UseDefaultCredentials"; it's also cleared during redirects.

* apply feedback

* Added comment about virtual methods (#3105)

* Added comment about virtual methods

Added a line about not overriding virtual methods because of issues involved with it.

* applying feedback

* Fixed: Invalid example code (#3204)

* Fixed wrong example code

A large chunk of the the example code in 'Listening by Registering a Callback' section had nothing to do with registering a callback. I added a small but complete example of using the CancellationToken.Register method.

* Fixed wrong example code

A large chunk of the the example code in 'Listening by Registering a Callback' section had nothing to do with registering a callback. I added a small but complete example of using the CancellationToken.Register method. (I submitted an equivalent change proposal for the C# example).

* Problem of round-tripping Double values (#3101)

* Problem of round-tripping Double values

* Addressed review comments, revised Single documentation

* Incorporated reviewer comments
@CoolDadTx CoolDadTx deleted the patch-1 branch February 1, 2018 04:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ 1st-time docs contributor! Indicates PRs from new contributors to the docs repository
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants