Can UML aggregation be both ways?

Viewed 1307

I am implementing an application with an MVC pattern in Python with the following class definitions:

class Controller(object):
    def __init__(self, model, view):
        self.model = model
        self.view = view

        self.view.register(self)

class Model(object):
    def __init__(self):
        pass

class View(object):
    def __init__(self):
        self.controller = None

    def register(self, controller):
        self.controller = controller

Classes are instantiated by

model = Model()
view = View()
Controller(model, view)

Controller has access to View, but View also has access to the Controller (since Controller passes itself to View). What is the appropriate way to represent such structure in UML? My guess would be

UML diagram of MVC.

but am not sure the aggregation in both ways exists.

2 Answers
Related