I have created two different plugins from a source plugin. The first plugin contains application logic classes and the second one contains User Interface classes. Currently I am having a problem because one class from application logic uses a static method in the UI plugin and I have to get rid of this dependancy otherwise I will get a circular dependency.
The method should remain in the UI class as it uses eclipse and SWT widgets (opens a MessageDialog for the user) and I cannot also move the class calling this method to UI plugin as there is a lot of other application logic classes using it and even inheriting from it.
I thought the 'observer pattern' will solve the problem but it doesn't since in this case my UI class will be the observer (once it gets a notification from the observable logic class, it opens the message dialog) and my application logic class is the observable. Consequently when registering the observers, an instance of the UI class is needed. It is also the case when implementing a custom Observer pattern.
How can I solve this problem ?
I really need help. Thanks