I've been attempting to learn C#.NET for the past month or so, and the array of ideas that seems to always trip me up is encapsulation. As this is one of the three pillars of OOP, I feel that I am operating at a loss for not understanding their use and implementations more clearly. When learning, though, it is often useful to develop or assimilate mnemonics to assist in maintaining all this knowledge. Having a good reference manual on hand is one thing, but keeping a functioning base of understanding is another entirely.
When keeping track of whether a type/method is public
, private
, protected
, static
, or sealed
, I find myself wondering what and why all at the same time.
My question, then is how do you go about remembering encapsulation keywords and when to use them? Trial and error is what is working for me now as a student, but I would hope to move beyond that before making professional use of this skill.