2

I am a little confuse with the useful use of internal keyword in classes and properties in C#. Using the internal keyword doesn't we mixing logic with physical concepts? It is not bad idea mixing this two concepts?

For example, if we change the physical location for a specific class it can lead to errors even if we not change anything in the code.

And internal keyword is a OO concept or is just some concept invented for the C# language?

miguelbgouveia
  • 2,963
  • 6
  • 29
  • 48
  • The physical location has nothing to do with types visibility. In the case of `internal`, the only thing that matters is whether the type is part of the assembly or not (and in the case of `MSBuild` that will be the project). – haim770 Mar 03 '16 at 15:27
  • 1
    Hiding internal data structures = data abstraction: the first fundamental concept of object-oriented programming. – L-Four Mar 03 '16 at 15:29
  • 1
    Related [Practical uses for the "internal" keyword in C#](http://stackoverflow.com/questions/165719/practical-uses-for-the-internal-keyword-in-c-sharp) – Morgan Thrapp Mar 03 '16 at 15:29
  • It is object-oriented—not with respect to a single project but for multiple projects. – Cody Gray - on strike Mar 03 '16 at 15:31
  • You shouldn't typically be "moving" classes from one assembly to another. If you're doing that a lot you probably need to rethink your planning process. The `internal` keyword isn't the problem. – JLRishe Mar 03 '16 at 15:33

0 Answers0