I am fairly new when it comes to designing a system to carry data though multiple layers from backend to frontend.
Currently I have a class which when run, will immediately run a query on a date range of data and write it to a file. I am in the process of setting up a 'middleman' to access bits and pieces of my data and in turn send the data as a json object to the front end code.
Where I am getting held up is with my original code which handles the queries. I want to in a sense cache or hold onto a single instance of my lump data so that other higher level classes can call accessor methods on the parts of my data I want without multiple queries to the server needing to be made.
This might be too much of a high level design pattern question to answer without much detail, but any advice or pushes in the right direction for further research would be appreciated.