Where in code should one keep data that doesn't change?
<p>I have defined models based on the tables in the database. Now there are some models whose data hardly changes. For example, the categories of the products that an e-comm site sells, the cities in which it ships the products etc. These don't change often and thus to avoid hitting the db, these are currently saved as static variables. </p>

<p>The question is where in code should these static variables be located. Currently, in ProductCategory class (which is also the model representation) a static List is defined which if empty calls the db and loads the Product Categories. Similarly, the City class has a similar static List and so on. </p>

<p>These static Lists are then used across the application. I was thinking of creating a class called StaticData and then keeping all the static Lists within this class. That is now instead of </p>

<pre><code>ProductCategory.AllCategories.Find(p =&gt; p.Id = 2) 
</code></pre>

<p>I shall have </p>

<pre><code>StaticData.AllProductCategories.Find(p =&gt; p.Id = 2) 
</code></pre>

<p>Which do you think is a better approach? I am also aiming for testability and decoupled code. </p>

<p>Also, is there a better way to achieve these? How do you do something similar in your code?</p>
