3
votes
1answer
192 views

How to maintain encapsulation with composition in C++?

I am designing a class Master that is composed from multiple other classes, A, Base, C and D. These four classes have absolutely no use outside of Master and are meant to split up its functionality ...
1
vote
4answers
322 views

Data duplication vs Encapsulating. Which design to use?

The problem that I face is how to combine encapsulating and optimal memory use. I can't show you my code and therefore explain it on extensive (I hope) example. Let's say we need to have a database ...
0
votes
1answer
255 views

Is there a proper way to allow access to private list by reference?

I'm trying to provide a by-reference getter to a list of objects in a class. My setup looks something roughly like this: class c_Container { public: c_Item* Get(int uid); private: c_Item ...