I have just began learning UML, and I was wondering if a class could composite one way and aggregate the other way (if you understand what I mean). Let's make an example:
Maingui.java:
private controller;
public Maingui() {
controller = new Controller(this);
}
Controller.java
private maingui;
public Controller(Maingui gui) {
maingui = gui;
doSomethingWithMainGui();
}
private void doSomethingWithMainGui() {
maingui.doSomeThing();
}
Is this the correct way to show the association?