Hi,
We have seen lots of discussion in SO regarding the class vs struct in c#. Mostly ended with conclusions saying its a heap/stack memory allocation. And recommending to use structs in small data structures.
Now I have a situation to decide the simple data store among these two choices. Currenlty in our application we have thousands of classes, just acts as simple data stores (only exposed public fields) and they passed among different modules and services.
As per my understanding, i felt its better to move ahead with struct instead classes for the performance reasons. Because these are simple data structures only act as data stores.
Before proceeding with this, i need some expert advice from the people who experiences this struggle.
- is my understanding correct?
- i have seen most ORMs have classes as data stores. So i doubt there should a reason to go ahead with classes instead structs. what would that be?
Cheers
RameshVel