Section 13.3. Element Visibility


13.3. Element Visibility

Elements in a package may have public or private visibility . Elements with public visibility are accessible outside the package. Elements with private visibility are available only to other elements inside the package. You can model public or private visibility in UML by writing a plus or minus symbol in front of the element's name, as shown in Figure 13-11.

Figure 13-11. Since MD5Crypt has private visibility, it isn't accessible outside the security package


In Java, public and private visibility corresponds to a class being public or private to a Java package. A Java class is marked as public to a package by the public access modifier, as in:

 public class Credentials {} 

If the public keyword is absent, then the class is private to the package. Many UML tools don't offer the plus and minus symbols to show element visibility, so don't be surprised if yours doesn't.




Learning UML 2.0
Learning UML 2.0
ISBN: 0596009828
EAN: 2147483647
Year: 2007
Pages: 175

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net