• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Compilation of Cross package classes

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How does Java compiler do the compilation of two interdependent java classes in two different packages?
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Even within a package a pair of classes that reference each other must be tricky. I'd have to guess the compiler works part way through each class, just enough to understand the public interfaces, then goes back to work through every line of code.

Circular references are usually a warning sign about your design. They are unavoidable in some situations, so they aren't a fatal sign. (It's much worse in C, I guess.) But circular dependencies between packages are a "pretty bad" sign. Robert Martin has written extensively on dependency management. This paper talks about it; Google for more articles by the same author.
 
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
RE:

OO Design Quality Metrics
An Analysis of Dependencies
By Robert Martin

Good piece, professionally done. I saved it.
 
Stan James
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The book we recommend at least once a week: Agile Software Development, Patterns Principles and Practices is largely about dependency management. The metrics in that article are closely related to the last half of the book. A free tool called JDepends examines compiled code and reports all the metrics. A commercial tool called Lattix does even more with neat graphics and "what if" analysis for fixing dependency problems.
[ September 04, 2007: Message edited by: Stan James ]
 
A lot of people cry when they cut onions. The trick is not to form an emotional bond. This tiny ad told me:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic