How would one represent a Java anonymous class in a UML class diagram?
相关问题
- Delete Messages from a Topic in Apache Kafka
- how to define constructor for Python's new Nam
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
There are two really anonymous classes in Java First is the non-named inner class. Such as:
A citation from UML standard 2.5 (p.149):
So, as for anonymous java class, you should create a class block with only
:
as name and connect the container class to it twice - by container relationship and by one-direction arrow without a dot. From the other side, the:
block should connect to the parent class.According to the same source, an
Anonymous Bound Class
, that is the second anonymous class we meet in Java, but often do not notice it, when you use a template/generic class, as incan be shown by two ways:
bind
dependency, with substitution on it.I was looking for a way to represent a JavaScript object literal in a class diagram (I know it doesn't make much sense...)and I found this post.
I'd contribute with this link and image. Ciao.
http://www.uml-diagrams.org/class-diagrams.html
Illustration:
Source: