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
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!








