Returning List of Options without Database Query

My application has many different status types, which I need to reference many different times. I’d like to figure out how to use these lists without querying a table in the database.

Here’s an example:

Customer Status

This list of Customer Statuses may be referenced in dropdown lists, filters, and tables.

I can think of two options I don’t want to do:

  1. Create a customer_status_types table in the db and query this table every time I need to display the options - bad because unnecessary db hits

  2. Type the static list of options in every dropdown and filter (basically every time it’s used) - bad because it can’t be edited at once, more opportunities for typos, etc

How can I write this list once, save it, and reference it throughout the application? Would I use an array?

Thanks!

Community Page
Last updated: