I have a class called ServerSide in which another class resides called Cserver. The following code fragment should explain what I am 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 make a class diagram in UML which shows the relationship between the two classes, as I am unsure as how this can be drawn in UML. Will it be an association?
Thanks
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…