implementation question: friend vs. gets

Hi -

If I have a program that creates objects of two different classes (A and B), and B contains other objects (BB), which in turn contains still other objects (BBB)...

...and if A needs to get a value from BBB...

...is it better to use a series of get() functions (B.get() calls BB.get() calls BBB.get()), or is there a cleaner way to do this with "friending?"

Thanks.
Try to avoid using friend where possible. It's usually a sign of tightly coupled classes, and that's bad.
OK, thanks.
Only use friend when writing global namespace operators (such as stream << and >> operators). ;)
Topic archived. No new replies allowed.