cvkmohan

cvkmohan

Phoenix New App Naming

When we create a new application - what is the meaning behind naming the naming convention? Specifically, I could not understand the rationale behind naming the namespace to be MyApp and MyAppWeb. Can we not call them Domain and Web? My observation has been - by using the application name in namespace - and using it at many places - it is getting difficult to develop and reuse application starter templates. Even when we clone an application starter - we need to run a rename script to make the application our own.
I agree that all serious application developers here would like to develop application from scratch. But, my question is - by making it easier for using templates - is there a possibility of entry barrier getting lower for new entrants?
May be tI asked question in a bit round about way. The simple way to ask probably is - Should the Application Name be prepended for directories, all namespaces etc. - Or will they be better without it.

Marked As Solved

hauleth

hauleth

There can be one, and only one, module with the given name within each instance of the VM. Sometimes it is feasible to run more than one Phoenix application within the same VM instance. In such case there would be module name conflicts.

Also Liked

phcurado

phcurado

For module names there is a guideline: Library Guidelines — Elixir v1.12.3. This is for library but I think the same apply to other cases.
This way you avoid name conflicts and have a clear difference when using the code from a module of your app or a module from a library.

tomkonidas

tomkonidas

I guess a benefit is that if you ever need to move them into an umbrella or separate the app, your not left with a project called Web. MyAppWeb on its own or in a with a bunch of mixed apps is clear what it does.

Where Next?

Popular in Questions Top

joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New

Other popular topics Top

baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 44778 311
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 44265 214
New
saif
Hello everyone, Long time lurker first time poster here. I’ve recently begun working on Elixir full-time again! :raised_hands: It’s been...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New

We're in Beta

About us Mission Statement