I have a class which I am trying to implement. This class will be responsible for accessing a large data set - for e.g., 200,000 English words. The data will be stored in a vector (vector<string>).
I am not sure (based on good design practices) whether the class I am implementing should have a private data member declaring the vector? If not, where else could I define the data object, and how should it be managed (creation, deletion, etc.).
I know my question is very generic. I am learning C++ on my own, so I would appreciate any guidance and help. And please correct me if I am asking the question in a wrong way.
Then start using it. As you find functionality you need, you'll add it. As you find how it should be used, you'll make member variables public or private accordingly.
Next question: I am reading a lot about unit testing. If the above was my class, would my unit test be as simple as this:
1. Create a class, e.g. MyTestClass with various test functions/methods, for which each function/method would create a MyClass object, call the AddToList() and GetAllFromList() functions and verify that the read values match the expected values (e.g. corner cases, null, empty strings, duplicates, etc?)
2. In main(), call the functions I created in MyClass
Sorry for deviating from my original topic. Just trying to learn a few things along the way.