How to define better names for system entities?

Asked

Viewed 60 times

0

How to define better names for entities in my system. I have a user table. And I have a reset password table where I relate information from the password reset process (id, hash, expiration date_link, reset password_password, is_user, status) On my system I have the template reset password.class.php I learned that more suitable names for classes would be the nouns in a system specification. And that name "reset password" is not a noun ? About this structure mentioned, any tips ? Any tips on how best to define the entities and models of the system ?

  • There is a serious risk that this question will be closed, so I will express my opinion in comment, this is very relative, and in fact there are even some "standards" with entity naming issues, namespaces etc. And there are still some "convections" for each language, so I will not quote any, but what I use in PHP is nouns in plural and in English, ie, Users, Products, CartProducts; In your case to "reset passwords" I would use something like RePasswords or NewPasswords or RedefinedPasswords and this goes to the standard of the project or developer.

  • Wouldn’t reset password be a behavior of a class called password ? And shouldn’t entity be called log_password ? Wouldn’t it be more plausible ? .

  • in the case of an inheritance hierarchy, it could have a base class, called log, where log_password would inherit from log. /

  • In the question you only talk about the issue of naming entities, so I did not go into details of architecture/ development, but for me "reset password" would be an action of the entity Users, and how are already logged’s on the entity Users, then I wouldn’t worry about log_senha, since I "would have" log_users.

  • But log user would not have the log_password attributes. Hence the actual database normalization usage. In this context, you could help me Kaduamaral ?

  • So for me this "log_password" would be RePasswords { int id; int userId; string oldPassword; string newPassword; date created; int status; bool defined; } -> ID, User, Old Password, New Password, "request" date,, situation, set. My default would be more or less this, for your case.

Show 1 more comment
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.