"UML Distilled", p.110, paragraph 3: "Classes within packages can be public, private, or protected". I believe this to be an erratum. It is not true in Java at least. I don't know what language the author had in mind when coming up with the above statement; unless there is some UML-specific connotation that I am unaware of. Anyone? Panagiotis.
posted 19 years ago
Unless by "private" what is actually meant is "package-private". But in such a case what would protected really mean?
Perhaps Fowler is talking about Facades, which in my edition is on page 116. By using the "public" access modifier sparingly you can, in effect, make the "package" private, saving "public" for the methods you want to expose to the outside world. In that sense the "package" access is the access of the methods of the classes it contains.