kuon

kuon

Naming context, again

I have read many discussions on the forum about this topic, but I still have a few “wonderment”.

Basically, my folder structure (module name) is:

lib/my_app
├── account                  MyApp.Account
│   ├── access_tokens.ex     MyApp.Account.AccessTokens
│   ├── roles.ex             MyApp.Account.Roles
│   ├── users.ex             MyApp.Account.Users
│   ├── schemas
│   │   ├── access_token.ex  MyApp.Account.AccessToken
│   │   ├── role.ex          MyApp.Account.Role
│   │   ├── session.ex       MyApp.Account.Session
│   │   ├── user.ex          MyApp.Account.User

The MyApp.Account module is mostly composed of defdelegate that forward to submodules, like MyApp.Account.Users. Code outside of account folder can only interract with the MyApp.Account module.

The files in schemas are just ecto schemas. I removed the Schema in the module name, because it’s a bit long and doesn’t bring anything.

Now, I am quite happy with this, but I have an issue with the plural names MyApp.Account.Users for example.

It is a bit hard to spot in the filesystem and when searching for the file.

I was wondering if you had suggestions for a suffix.

Like MyApp.Account.UserContext or MyApp.Account.UserManagement … (those two does not convince me).

Most Liked Responses

christhekeele

christhekeele

I know they’re not super common in instructional material, but I find pluralized module names to be quite useful. They’re not that uncommon in Elixir projects!

Where Next?

Popular in Discussions Top

Jayshua
I recently came across the javascript library htmx. It reminded me a lot of liveview so I thought the community here might be interested....
New
owaisqayum
I have a sample string sentence = "Hello, world ... 123 *** ^%&*())^% %%:>" From this string, I want to only keep the integers, ...
New
New
AstonJ
Please see the new poll here: Which code editor or IDE do you use? (Poll) (2022 Edition) It’s been a while since we first asked this, I...
208 31142 143
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
hazardfn
I suppose this question is effectively hackney vs. ibrowse but we are at a point in our project where we have to make a choice between th...
New
restack_oslo
Hello, Please pardon me for any faux paux. I am 46 and this is my first time on a forum of any kind. I wanted to to get answers from tho...
New
tomekowal
Hey guys! I want to create a toy project that shows a chart of temperature over time and updates every 5 seconds. I feel LiveView is per...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New
paulanthonywilson
I like Umbrella projects and pretty much always use them for personal Elixir stuff, especially Nerves things. But I don’t think this is ...
New

Other popular topics Top

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
Nvim
Anybody knows a comprehensive comparison of Django and Phoenix, thanks for the help. Where are they similar? Where do they differ the m...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New

We're in Beta

About us Mission Statement