Skip to content

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

Merged
merged 2 commits into from
May 4, 2017
Merged

Conversation

ricardomlourenco
Copy link
Contributor

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

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)
@dnfclas
Copy link

dnfclas commented May 4, 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

Copy link
Contributor

@rpetrusha rpetrusha left a 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
Copy link
Contributor

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.)
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor Author

@ricardomlourenco ricardomlourenco left a 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?

Copy link
Contributor

@rpetrusha rpetrusha left a 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.

@rpetrusha rpetrusha merged commit 68fbe2e into dotnet:master May 4, 2017
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 this pull request may close these issues.

3 participants