-
Notifications
You must be signed in to change notification settings - Fork 6k
Update classes-and-objects.md #2092
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
Conversation
A Program in .Net can be composed of none, one or several Dlls. Each Dll is an Assembly. So the "Access limited to this Program" would be incorrent and it can drive the Programmer to an incorrect or misundertood interpretation of the internal modifier. reference: (my experience and https://msdn.microsoft.com/en-us/library/7c5ka91b.aspx)
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for noticing and correcting this inaccuracy, @ricardomlourenco! Would you mind making a few more changes?
@@ -63,9 +63,9 @@ Each member of a class has an associated accessibility, which controls the regio | |||
* `protected` | |||
- Access limited to this class or classes derived from this class |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since protected
is applied to a member, it's better to phrase this as, "Access limited to the containing class or classes derived from the containing class."
@@ -63,9 +63,9 @@ Each member of a class has an associated accessibility, which controls the regio | |||
* `protected` | |||
- Access limited to this class or classes derived from this class | |||
* `internal` | |||
- Access limited to this program | |||
- Access limited to this Assembly (.exe, .dll etc.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better: "the current assembly (.exe, .dll, etc.)" Note that assembly should not be capitalized.
* `protected internal` | ||
- Access limited to this program or classes derived from this class | ||
- Access limited to this Assembly (.exe, .dll etc.) or classes derived from this class |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better: "the current assembly (.exe, .dll, etc.)"
Implemented ajustments requested by Ron Petrusha
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes implemented. Should I create another PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making the additional corrections, @ricardomlourenco. No, it's not necessary to open a new PR -- your changes just appear as the last commit in the current PR. I'll merge this as soon as the build completes successfully.
A Program in .Net can be composed of none, one or several Dlls. Each Dll is an Assembly. So the "Access limited to this Program" would be incorrent and it can drive the Programmer to an incorrect or misundertood interpretation of the internal modifier.
reference: (my experience and https://msdn.microsoft.com/en-us/library/7c5ka91b.aspx)
Title
Corretion on Accessibility "internal" to avoid misunderstood or incorrect concept
Summary
The way that internal modifier is explained here can lead to misunderstand and it should be explained in a better way.
Details
The original documentation is: "protected internal - Access limited to this program or classes derived from this class"
This might lead the Developer to think that internal modifier is used on Program scope which is incorret. internal modifier means that the object is visible in the current Assembly not Program, since the Program can contain several assemblies.
I suggest change Program for assembly unless you define Program = Assembly