Reputation: 301
The following class is run to instantiate all the other classes for my program. I'm wondering how to represent the relationship between the StartHere class and the UI class in a structural UML diagram.
import java.awt.EventQueue;
public class StartHere {
public static void main(String[] s) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
UI frame = new UI();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
}
Upvotes: 0
Views: 156
Reputation: 6529
I would recommend a dependency, as the reference is not retained. If the reference were retained in a field, I would recommend an association.
Upvotes: 1