Jump to content
MakeWebGames

Thoughts so far


DeathsAlive

Recommended Posts

Been developing with NWE for a little while now. And I have got to say, I really do like the framework/engine.

But one thing that I have found, and repeatedly annoyed me. Why do a lot of modules not conform to at least 2nd or 3rd normal form (Normalization) standards (in terms of database design) but also, they reference the players by username and not ID...?

And some even store the username in database as the reference point.

Please tell me I'm not the only one who finds this rather annoying?

Link to comment
Share on other sites

Been developing with NWE for a little while now. And I have got to say, I really do like the framework/engine.

But one thing that I have found, and repeatedly annoyed me. Why do a lot of modules not conform to at least 2nd or 3rd normal form (Normalization) standards (in terms of database design) but also, they reference the players by username and not ID...?

And some even store the username in database as the reference point.

Please tell me I'm not the only one who finds this rather annoying?

Sounds like poor module design, should ideally be referencing on primary keys, and I doubt the username is a primary key.

Link to comment
Share on other sites

In the official mods I doubt there is the username as primary key. If you have any example, we could discuss it.

For the normalization of the tables, there is a couple of tables which are on purpose not normalize. Example being the polls, and the stats. Stats are fixed (days or month) and keeping them in a non-normalized form you will have better performances while retrieving the data and updating a given entry. For the polls giving 10 different options should suffice, and made me save time as I didn't had to design a special admin panel for it.

BTW be careful with full normalization inside tables. Some times allowing a bit more columns may improve the performances and actually use less space. Each time you do a child table, you will need a foreign key and it will require more time for the data retrieval. Sure, don't go to far either as you would end up with tables with 200 columns ;) As always you will need to find a good compromise between the two extreme, and there is no single right solution.

Link to comment
Share on other sites

Maybe I haven't been paying attention but I haven't seen a module reference player by name instead of player id or am I blind or not understanding?

The only one I noted down (without diving into PHPMyAdmin) was "messages" and "sent_to"

 

In the official mods I doubt there is the username as primary key. If you have any example, we could discuss it.

For the normalization of the tables, there is a couple of tables which are on purpose not normalize. Example being the polls, and the stats. Stats are fixed (days or month) and keeping them in a non-normalized form you will have better performances while retrieving the data and updating a given entry. For the polls giving 10 different options should suffice, and made me save time as I didn't had to design a special admin panel for it.

BTW be careful with full normalization inside tables. Some times allowing a bit more columns may improve the performances and actually use less space. Each time you do a child table, you will need a foreign key and it will require more time for the data retrieval. Sure, don't go to far either as you would end up with tables with 200 columns ;) As always you will need to find a good compromise between the two extreme, and there is no single right solution.

The polls one I could live with, that was for high simplicity :)

I'm just redesigning and altering the modules to suit my needs. Just makes me "grr" when I see it. Not all official modules. Some are from the market place.

Link to comment
Share on other sites

The messages sent_to is on purpose, it allows multi-destinations (if implemented), and the reply to all, the link to the user id is "inbox_of" as well as "from_user", therefore as you see, it's really on purpose ;)

For the modules written by other authors, I honestly don't remember, and would also not change the way each author write his/her modules.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...