> ...
>
> -Paul
> I'm not sure what you think is needed.
This is a different question than what the spec. requires.
> If there are duplicate
> class names in different packages (something that should not be
> prohibited, to be sure), then something must be done to avoid clashes,
> and putting source files into different directories is the obvious
> solution.
Yes, in C and C++ you can put the generated files in arbitrary directories
and have the source files in arbitrary directories.
In Java there is some mapping required to keep a.b.MyClass separate from
MyClass, separate from a.MyClass etc. On systems which use directories for
storing packages this mapping is 1 package name to 1 directory. This is useful
and very practical extra imposed rule that is mentioned in the standard
with loopholes for those who want to use some other mappings. As you point out
other mappings are possible and exist including VisualAge and Jar files which
both have there own internal structures that don't coorespond the the underlying
OS directory structure.
Eclipse in it's default install imposes additional organization on the input.
It can still deal with duplicate source for the same packaged class, but
it wants packages to coorespond to the mapping it has choosen. Since it is using
directories and files, it wants the same package->dir mapping that it uses for
the output mapping. So how can you then have two of the same class? You can
have many source directory trees, not all packages need be in all trees.
Problem solved.
> However, I think it should be up to project designers and developers to
> decide how to arrange their source files and not something that's imposed
> by an arbitrary conflation of a program's physical and logical
> structures.
We'll see how long such extra levels of arbitrariness are seen as virtue. I
would call putting a.b.c.MyClass in a/b/c/foobar/MyClass.java as 'arbitrary
conflation' while I see enforcing output and input to have a physical layout
which cooresponds to the logical organization as sensible, practical and
rational organization. YMMV.
What this discussion doesn't answer is whether Eclipse can turn off this input
file package -> directory mapping rule, it only suggests why it is sensible to
start with input and output following the same scheme.
> The Java designers also foresaw the case (or simply recognized the
> practice)
When they designd it they were the only ones using Oak, so they weren't
"recognizing any practice."
-Paul
Randall Schulz - 22 Sep 2004 22:40 GMT
At Tuesday 21 September 2004 09:41 in comp.lang.java.softwaretools P.Hill
wrote:
> ...
>
[quoted text clipped - 3 lines]
> When they designd it they were the only ones using Oak, so they weren't
> "recognizing any practice."
I believe Visual Age for C++ pre-dated it's Java counterpart. By
"recognizing [a] practice", I was thinking of that IDE as well as
expecting there could be others of which I am unaware.
> -Paul
Randall Schulz