Badger
Badger

Reputation: 301

How to represent this class relationship in UML? (java)

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

Answers (1)

Jim L.
Jim L.

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

Related Questions