"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.
Panagiotis Varlagas
Ranch Hand
Joined: Nov 27, 2000
Posts: 233
posted
0
Unless by "private" what is actually meant is "package-private". But in such a case what would protected really mean?
Desai Sandeep
Ranch Hand
Joined: Apr 02, 2001
Posts: 1157
posted
0
You can have a private inner class (static or non-static).Probably that is what Martin Fowler meant Hope this helps, Sandeep
<b>Sandeep</b> <br /> <br /><b>Sun Certified Programmer for Java 2 Platform</b><br /> <br /><b>Oracle Certified Solution Developer - JDeveloper</b><br /><b>-- Oracle JDeveloper Rel. 3.0 - Develop Database Applications with Java </b><br /><b>-- Object-Oriented Analysis and Design with UML</b><br /> <br /><b>Oracle Certified Enterprise Developer - Oracle Internet Platform</b><br /><b>-- Enterprise Connectivity with J2EE </b><br /><b>-- Enterprise Development on the Oracle Internet Platform </b>
Steve Mitchell
Greenhorn
Joined: Jun 03, 2001
Posts: 12
posted
0
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.
Steve Mitchell<br /><a href="http://www.byteworksinc.com" target="_blank" rel="nofollow">http://www.byteworksinc.com</a>