• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Refactoring question

 
Author
Posts: 144
5
jQuery Eclipse IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We have two eclipse projects

project A depends on project B but in one file in project B I need to call into A. Is there a way to do this? If so how? I thought about an interface and abstract class but I can't figure this out. I want to avoid circular dependencies.

Thanks,
Tom
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Tom,
It sounds like you really have three logical units. Can you refactor the common code to a third project? This would avoid the circular dependency.
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A third project might be just the answer, or you might be able to change things around with an interface. Here's an intro to Dependency Inversion that sometimes does the trick. The first slide is a picture of Robert Martin's "Agile Software Development" which is the place to learn dependency management, highly recommended.

BTW: Kudos for recognizing the problem! Some folks near me at work use a build procedure that deletes all compiled classes and starts from source code. They have two jars that depend on each other, and they cannot build either one first.
[ December 06, 2007: Message edited by: Stan James ]
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic