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.
Asked
Active
Viewed 1.2e+01k times
5 Answers
185
It indicates a protected member of a class or other data type.
-
Indicates private
+
Indicates public
#
Indicates protected

Mike Hofer
- 16,477
- 11
- 74
- 110
-
1Yes, or protected 'operation'. – Jayden Jan 06 '09 at 21:54
-
1The visibility indicator can apply to association ends as well as attributes and operations. – chimp Jan 06 '09 at 22:41
-
I've seen some UML diagrams define `f` for final (functions that cannot be overriden), `underline` or `s` for static functions, and `italics` or `a` for abstract functions. – Yzmir Ramirez Apr 23 '11 at 18:13
-
What if you dont want a modifier/symbol ? Just leave it blank? – Vipin Verma Sep 27 '17 at 06:36
-
@vipin8169 Yes. However, the default accessibility modifier is language-specific. For example, in Visual Basic, it's `public`, whereas it's `internal` 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. – Mike Hofer Dec 14 '17 at 14:02
8
'#' indicates the visibility. In this case it refers to a protected operation [ edited out the term 'method' as this is not as generic ].

Jayden
- 2,656
- 2
- 26
- 31
-
PS: The reference to look this up is UML 2.0 In A Nutshell. A desktop quick reference. Dan Pilone, Niel Pitman. O'Reilly. – Jayden Jan 06 '09 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'. – Jayden Jan 06 '09 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. – Mike Hofer Jan 06 '09 at 21:59
-
4
'#' 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

matang
- 259
- 2
- 9
-
Great answer does not only answer the question, but also helps the viewer to learn more. Thank you! – soMuchToLearnAndShare Nov 23 '21 at 22:32
3
It implies that it is protected, for a variable it will only be seen in the class and inherited classes.

william.eyidi
- 2,315
- 4
- 27
- 39