This is an iOS app but I will try to make it as general as possible because I think a wide audience could have good feedback.
I have a application I am making for iOS. It has 4 main tabs in a tab bar controller. There is three main model objects. Lets say they are apple, car, and clock. The first tab needs access to all the apples from an api, the second needs all the cars, and the third needs all the clocks. The fourth tab needs access to all three lists of objects.
I have implemented the first 3 tabs already and once the user goes to the first tab it will load in all the apples, same for the other 2 tabs. But now as I am starting the fourth tab I don't want to load all the objects in again (I could but it seems wrong).
I'll go ahead and give what I think might be proper and then hopefully I can get feedback if this is correct or if there is a better solution.
Proposed Solution: A class that contains a list of apples, cars, and clocks. Then each tab will get there needed list from this class. If the list hasn't been retrieved than the class containing the lists will call the api to retrieve the needed list. So I guess an object with 3 singleton objects, is this proper code design?
So as far as code structure I would have
Model: - Car - Apple - Clock - ListHolder(Is there a better way to name this?)
Controllers: - Network Controller(To call the api)
View Controllers: -The 4 view controllers