• 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

Eclipse - A cycle was deteced in the build path

 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm actually using RAD but I'm sure this is the same issue in Eclipse.

I have two projects. Classes in both projects refer to classes in the other project. For that reason I have to add each project to the other project's build path.

RAD gives me the error "A cycle was detected in the build path of a project".

Searching the 'net I've found many instances of this problem and the only solution is to specify this as a warning instead of an error.

What's the proper way to handle this case? When you have two projects that refer to each other is there another way to configure the build path aside from adding each project to the other project?
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When you have two projects which refer to each other, there's a good chance you haven't structured the projects right. Perhaps there should only be one project. Or perhaps there should be more than two projects.
 
Todd Johnson
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is an abolutely massive project. It's 10 million lines of legacy non-java code that are slowly being rewritten into java. It spans many different disciplines (financial, inventory, human resources, etc, etc).

Without boring you with a ton of details my core DAO pattern classes all exist in a "foundation" project. The implementation of the DAO objects themselves all exist in seperate projects (let's take the Invetory project for example). The DAOFactory (actually a concrete implementation for a specific database) in the foundation project is the one that hands the individual inventory DAO objects out. So that's where the circular reference comes from. The foundation project defines an abstract DatabaseDAO class, the inventory package implements DAO objects which extend the DatabaseDAO class in the Foundation project. The DAOFactory implementation in the Foundation project is the one that hands out the inventory DAO objects.

On smaller projects I'd just put the DAO object implementations in the same place as the DAO core code. But in this case it would become massive and 100 developers would all be trying to work on it simultaneously. It makes more sense for the DAO object implemenations to be in their respective specific projects.

I need a whiteboard!

Basically this is a text book Sun DAO pattern implementation where all the boilerplate (DAOFactory abstract class, DAOFactory concrete class, DAO abstract class) all exist in one project and the actual DAO object implementations will be in another project. Actually there be in a lot of other projects, but for this example just limiting it to one other project demonstrates the problem.
[ October 21, 2008: Message edited by: Todd Johnson ]
 
Paul Clapham
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's all very well, but you asked about the "proper" way. I would still say if you have two projects which refer to each other, then don't do that. That would be the "proper" way to fix it.

However if you want to ask about the "practical" way, that's another question.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic