Are modules analogous to namespaces in C# or packages in Java?

Dejan Lekic dejan.lekic at gmail.com
Thu Jan 2 02:37:24 PST 2014


On Wednesday, 1 January 2014 at 17:43:54 UTC, Afshin wrote:
> Modules confuse me as a way to organize code.
>
> If a module is composed of multiple classes, it seems that the 
> module semantics in D encourages putting all those classes in 
> one file.
>
> Can someone explain how to organize a set of classes into a 
> module (or namespace, or package) so that each class can have 
> their own file?

Java is not (yet) truly modular programming language. Java 8 is 
supposed to include Jigsaw (module system for Java). More about 
it: http://openjdk.java.net/projects/jigsaw/

Packages in D are similar to packages in Java.
Concept of modules as I wrote above, does not yet exist in Java.


More information about the Digitalmars-d-learn mailing list