UML class diagram, how to show a class that extends the stream?

I have a class called ServerSide that contains another Cserver class. The following code snippet should explain what I'm talking about:

public static void main (String [] args) throws Exception { System.out.println("The server is running."); int clientnumber = 1; ServerSocket server = new ServerSocket(9090); try { while (true) { new cserver(server.accept(), clientnumber++).start(); } }finally { server.close(); } } private static class cserver extends Thread { private Socket socket; private int clientnumber; private ConnectionHandler c_handler; private Protocol protocol; public cserver(Socket socket, int clientnumber) { this.socket = socket; this.clientnumber = clientnumber; log("New connection with Client: " + clientnumber + " at " + socket); } 

I want to create a class diagram in UML that shows the relationship between the two classes, as I am not sure how this can be done in UML. Will this be an association? Thanks

+7
java uml relationship class-diagram
source share
3 answers

This will be the diagram, this is the inheritance relation (IS-A):

enter image description here

+16
source share

The meaning of this relationship is: "the cserver class is the Thread class, but the Thread class is not the cserver class."

inheritance

I recommend you use CServer as the class name, check out these Java naming conventions: http://en.wikipedia.org/wiki/Naming_convention_(programming)#Java

+4
source share

This is inheritance: http://www.teach-ict.com/as_as_computing/ocr/H447/F453/3_3_6/uml/miniweb/pg6.htm

In Java extends , the IS-A relationship is explicitly defined.

+2
source share

All Articles