We have data that's updated nightly in a database residing in the same instance as my app's database. So to save on database calls, I want to cache this static-for-the-day data into a List(Of MyObject). From a theory point of view, should this cached List(Of ) be cached in the presentation layer code, via a global variable? Should it be in a global variable in the .DLL?
I'm thinking in the .DLL, because I created a service layer, which is exposed publicly to the GUI and makes calls to the data access layer inside the .DLL:
Public Shared Function Search(ByVal criteria As Core.Other.Customer) As List(Of Core.Other.Customer)
' TODO: Check the customer cache to see if it has been populated yet. If not, populate it.
If 1 = 1 Then
' TODO: Variable "list" needs to be a global object in the DLL.
' For SO readers: Dal class declared Friend.
Dim list As List(Of Core.Other.Customer) = Dal.Search.Customers.GetCache()
End If
Dim results As New List(Of Core.Other.Customer)
' TODO: Find the relevant customers in the cache and add them to variable "results".
Return results
End Function
Am I going about this the best way that I can?