0

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

azurefrog
  • 10,785
  • 7
  • 42
  • 56
  • have you consider instead using observer pattern, restructure your projects, and create thirdone with all shared code, and make both plugins depends on that one – user902383 Dec 10 '14 at 09:32
  • Hello and thanks for your answer. These two plugins interacts already with other plugins. How do a third plugin will solve the problem ? My main purpose is to avoid the call for this graphic method. Would you provide me with more details please ? – user2560860 Dec 10 '14 at 09:50
  • i'm not saying about creating another plugin, but more something like library with shared code, and i cant be more specific as i don't know structure of your code – user902383 Dec 10 '14 at 11:12

0 Answers0