Here is what I found. I will just follow the image below (if possible), but discuss first. Naming something in UML does not mean that it cannot be anonymous in the implementation. I struggle more with the fact that it is “inside” of another class more complicated, therefore the line of package / component inclusion, which is used below. You can also use an instantiated connection to show what you are looking for. You can also use components as they allow inclusion. In the end, although I am torn, why would you model an anonymous class, because it is not part of the structure, since you never refer to it outside the class (IN GENERAL), but more on behavior. Thus, why instances and properties allow anonymous elements. If you start modeling LISP, etc., this question will become really funny.
Updated for UML 2.0: Anonymous Class Example http://www.informit.com/content/images/chap3_0131428489/elementLinks/03fig22.gif
Note that in Figure 3.22 and that the author says “Stereotype”, which is incorrect because it is not part of the language, therefore it is a keyword, which means not any part of the formal model, any old line. Not all tools support notation, but RSA / RSM does my surprise and uses something close to notation.
Source page - http://www.informit.com/articles/article.aspx?p=336264&seqNum=3
From the UML specification itself:
For properties - A property symbol may be displayed containing only one name (without a colon) in its name string. This implies defining an anonymously named class nested in the namespace of the containing class. The part has this anonymous class as its type. Each appearance of an anonymous class is different from any other event. An anonymously defined class has the properties specified with the part symbol. It is allowed to display compartments defining attributes and operations of an anonymous named class.
For instances - (Names are optional for instances) The standard notation for the specification of an anonymous instance of an unnamed classifier is the underlined colon (":). If the instance specification has a value specification as its specification, the value specification is displayed either after the equal sign (" = ") after name, or without an equal sign below the name: If an instance specification is shown using a closing form (for example, a rectangle) that contains the name, the specification of the value is Rage in the form of closing.
source share