What is the best approach in storing a large class (A) in another class(B)?
a.) store the class(A) pointers to class (B)
b.) store the class(A) to class(B)
The problem with the first is on the responsibility of first is on the responsibility of destroying instances of A. B will have to destroy objects he did not create.
On the other hand, the problem with the second approach is speed. B will have to create a new instance of A to store.
Any other options? comments?
|