Circular import problem

Hi;

How resolve the Circular import problem when the controller (MVC) is puted in a separate package :

- GUI must import Controller to call 揳ctionPerformed?of Controller

- Controller must import GUI to forward it the data to display

The Swing GUI classes are grouped in only one GUI package and I would like to leave the controller of this package and put it with the service package (package where the actions are executed).

Currently I moved the class Controller in the GUI package to avoid this violation.

The controller implements a ActionListener to perform the events buttons.

Regards

I

[648 byte] By [yanis97a] at [2007-10-3 9:47:22]
# 1
Use interfaces to make the link between M-V-C without crossing packages references.For example: - link between View and Controller is done via an ActionListener.- link between Model and Controller is done via a ModelListener.
Franck_Lefevrea at 2007-7-15 5:04:19 > top of Java-index,Desktop,Core GUI APIs...