Is it a bad practice to store relatively large amounts of volatile data in lists?

I am working on an iPhone application in which I manage some kind of “agenda”. The application must be authenticated on the server in order to work (= without offline mode), so I do not need any persistence on the iPhone.

Is this a bad practice if, as soon as I receive data for programs from servers (about 10-50 lists ~ 30 days), I store them in C # user objects containing lists of other objects (mainly months containing days), instead of setting up a database or using XML? I need to be able to edit and search through them quite easily (I use LINQ with success in my POC at the moment)

Thanks in advance, Regards,

C.Hamel

+3
source share
3 answers

No, this is not a bad practice. You do not need to save this data, so there is no need for a local database or XML. You still need to load data into memory in order to perform a search ...

+4
source

As long as there is no need to save data, it is normal to store in memory.
By the way, it is quite simple and quick to serialize data on the iPhone, if you prefer (in case of low memory).
Serialization and archiving? The answer to the question of archiving and serialization. Hope this helps if you want to save (serialize) the data.

+1
source

I'm not too sure how the iPhone allocates memory for its processes; it can also vary from model to model. You may encounter some painful problems when the device does not allow you to allocate sufficient memory for all your data.

Despite the fact that the storage of data in memory is very fast, I propose to save it partially. You can leave with the limited cache of the latest data obtained during access, and save everything else. It is more reliable and secure, maybe a little slower, so you need to find a balance.

0
source

All Articles