How to structure packages

Chris Angelico rosuav at
Sat Sep 10 06:29:57 EDT 2011

On Sat, Sep 10, 2011 at 8:11 PM, Nobody <nobody at> wrote:
> I suspect that the one-to-one correspondence between classes and .class
> files is mostly technical (e.g. Java's security model). The one-to-one
> correspondence between class files and source files could probably be
> relaxed, but at the expense of complicating the IDE and toolchain.

One class per object file isn't a problem - you can always .jar your
classes if the proliferation of small files bothers you, and then it's
just a different way of indexing the mound of code.

One class per source file complicates the human's view in order to
simplify the tools'. Not sure that's really worthwhile.

> I never saw it as a problem, given that Java is fundamentally class-based:
> there are no global variables or functions, only classes.

Yeah... of course you can easily simulate globals with static members
in a dedicated class, but it's slower. THIS, though, is where Java's
security model comes in - you can assign security X to Globals1.class
and security Y to Globals2.class, rather than trying to juggle
security issues in a monolithic "globals" namespace. IMHO it's not
worth the hassle, though. I'd rather just have globals.


More information about the Python-list mailing list