I've got a class which creates an instance of another class. "ServerThread" configures a socket for an incoming connection, and "ServerLogic" waits for any incoming messages.
ServerThread creates an instance of ServerLogic, and invokes the "run" method in ServerLogic. ServerThread does not store a reference to the ServerLogic object, and because these will be running on the same thread, ServerThread will be on hold until ServerLogic stops listening/the socket is closed.
Here is an image of the two classes I'm talking about:
How would I represent this kind of relationship in a UML class diagram?
Thanks.
I understand that your ServerThread
and ServerLogic
are structurally independent: no reference between each other is maintained. So there is no association between them. You could however draw a dependency (dashed line with arrow) from ServerThread
to ServerLogic
with the stereotype «Instantiate»
.