Consistent and Customizable Model Naming Conventions #6
inishantthakur
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Here's a draft for your GitHub discussion post:
Proposal: Consistent and Customizable Model Naming Conventions
Issue Summary
The current naming conventions in the project are causing confusion due to inconsistencies with global standards. For example, in the real-world hierarchy:
Our current setup has a model named
City
that actually represents what should logically beState
. This discrepancy leads to misunderstandings during development and increases the cognitive load for contributors.Why This Matters
Proposed Solution
We propose the following two-part solution:
Adopt Global Standards for Model Naming
Models should reflect universally accepted or domain-specific terminology. For instance:
City
model toState
.Country
,State
,City
,Area
,Location
).Allow Customizable Naming
Introduce a mechanism to customize model names if a project has specific requirements. For example, Laravel's naming flexibility can be utilized:
State
→Province
).Benefits
Next Steps
If the team agrees:
City
model toState
and updating relevant references (migrations, relationships, etc.).We’d love to hear thoughts or suggestions from the community on this proposal.
This post ensures clarity and opens the floor for feedback while presenting a clear argument for aligning naming conventions. Let me know if you'd like further refinements!
Beta Was this translation helpful? Give feedback.
All reactions