8 Mar 2011 19:16
Re: Re: Test Protected Methods Directly via Subclass, Automatically?
Adam Sroka <adam.sroka <at> gmail.com>
2011-03-08 18:16:18 GMT
2011-03-08 18:16:18 GMT
Fair enough. I can't actually recall the last time I used the keyword "protected" in my own code. Either someone else uses it (including tests) and it is "public" or else it is only used internally and it is "private." In fact, I truly prefer languages that don't bother with the distinction, though most of my customers end up roping me back into Java-land. On Tue, Mar 8, 2011 at 10:06 AM, Michal Svoboda <michal.svoboda <at> agents.felk.cvut.cz> wrote: > > > > Adam Sroka wrote: > > P.S. some of us (I) assume that a protected method is an implementation > > detail that can be renamed, moved, or inlined safely. > > IMHO only a private method can be safely recognized as an implementation > detail. Protected methods are visible outside the class, therefore they > are part of the interface that the class provides, albeit only to a > limited number of clients. > > Notable cases of dual interface classes can be found in almost all GUI > frameworks. Though I fully agree that a class with only one interface > is much easier to handle. > > Michal Svoboda > > [Non-text portions of this message have been removed] > >(Continue reading)
RSS Feed