The convention is only to name all your modules inside your application/package as MyApp.MyModule
(assuming that your application/package is named MyApp
.) That is more or less similar to java convention to name packages com.example.blah...
.
This is done to prevent name clashes between different applications/packages.
Elixir core modules are not namespaced (there are some exceptions like String.Chars
, though.)
Inside your application/package it is totally up to you whether to choose the flat model for module naming, or hierarchical.
BTW, the module name might be any valid atom. The dot is the convention only, it affects neither mode accessibility for the compiler nor anything else. Module.concat/{1,2}
helper uses dot to build up module names, but again this is the convention only.
Foo.Bar.Baz
defined without having aFoo
orFoo.Bar
. – Contrabassoon