I was reading Algorithms in a Nutshell (O'Reilly) and came across this symbol in a class diagram. My guess is that it means the member is protected, but I wanted to see if anyone knows for sure what it means.
5 Answers
It indicates a protected member of a class or other data type.
-
Indicates private
+
Indicates public
#
Indicates protected
-
1
-
1The visibility indicator can apply to association ends as well as attributes and operations.– chimpJan 6, 2009 at 22:41
-
I've seen some UML diagrams define
f
for final (functions that cannot be overriden),underline
ors
for static functions, anditalics
ora
for abstract functions. Apr 23, 2011 at 18:13 -
-
@vipin8169 Yes. However, the default accessibility modifier is language-specific. For example, in Visual Basic, it's
public
, whereas it'sinternal
in C#. If your diagram doesn't make it otherwise clear what the default accessibility modifier is, it's a good practice to include the access modifier symbol. Dec 14, 2017 at 14:02
'#' indicates the visibility. In this case it refers to a protected operation [ edited out the term 'method' as this is not as generic ].
-
PS: The reference to look this up is UML 2.0 In A Nutshell. A desktop quick reference. Dan Pilone, Niel Pitman. O'Reilly.– JaydenJan 6, 2009 at 21:51
-
Oh yes, my terminology isn't accurate. A bit sloppy. The below post by Mike Hofer uses the term 'protected member'. I think if you want to be completely accurate / agnostic, you could say a 'protected operation'.– JaydenJan 6, 2009 at 21:53
-
Wasn't trying to be snarky, and I apologize if it seemed I was. Truth is, the symbol can be applied to attributes as well as operations, so its scope is a bit broader, and I wanted to be sure that was clear. Again, my apologies for seeming crass: it was not my intent. Jan 6, 2009 at 21:59
-
'#' stands for visibility "protected" (similar to public,private ) behavior of the property/methods in the class . You can find more of the same at uml_basic_notations
-
Great answer does not only answer the question, but also helps the viewer to learn more. Thank you! Nov 23, 2021 at 22:32
It implies that it is protected, for a variable it will only be seen in the class and inherited classes.