caching - Enum vs cache? Which one is better -


i found out co_workers using enum lot. , using enum kind of data store lists, status list, role list, etc.. , not sure if way deal kind of data. put data db , read them cache instead of putting data code itself.

the decision of enum vs. database table depends on whether expect additional values added/removed while system in production.

for example:

use enum for:

  • payment method (cash, check or credit card)

  • billing frequency (daily, weekly, monthly, quarterly)

  • gender

  • status

use database table for:

  • carrier delivery (fedex, ups, ???)

  • product category (books, music, games, ???)

  • airline


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -