views:

49

answers:

1

Hi, We have a desktop application.We have master data which we want to keep in memory.Should we go for a class which has list of all collections(static) and is filled once the application starts.What are the alternate strategies? I would like to avoid 'static' based solutions. thanks

+1  A: 

Static member of class is designed for data that are common (and should be shared) to all instances.

Put whole data into one class first. Move all functions that only modify those data to that class. And try it for a while. If it is not enough (and you need to be sure hat there are only one piece of those data) introduce Singleton. This is a good equivalent of global data in OOP.

przemo_li
+1 for singleton, but the explanation could use some work.
Matt Luongo