I do not know how I should leave those attributes.
I do not know how I should leave those attributes.
It depends on what you want. If you leave it private, the derived class will not be able to access it directly. It's usually what you want. If the derivative needs to access the attribute directly for something, leave it protected. Indirectly (through a protected or public method) it is clear that it can be accessed.
Some people say that protected
should not even exist in the language. I think it's an exaggeration, but gives an indication that it should be used sparingly. Many think that either the thing is public or private. I'd rather have more granularity. Only experience will indicate when something really should be protected without causing problems. So some prefer never to have protected attributes. Private attribute always gives more freedom to those who draw the abstract (or normal) class. The private is implementation detail. The protected already creates a coupling that may be unnecessary or even harmful in some cases.
I'm not a fan of the term attribute for this, I prefer field .