Design Pattern Advice

@StngBo ,

Yes, these structures are defined in Singletons using The StorageHelper library. They, in turn, call the Singleton for my persistent storage technology - FRAM. The cool thing about this is that you could switch to using Flash for example without changing anything in you code that accesses these variables.

You can see how I do this in my gateway repo if you are interested (see the MyPersistentData files).

My understanding is that these variables are stored in the persistent storage not in the Boron's working memory with a small cache that can be cleared manually or will be flushed every second or so. I believe this is a more efficient approach as your data is stored to persistent memory and you are not keeping all these variables in memory.

Did this answer your question?

Chip

1 Like