Re: Using a Resource as a Class Property



..oO(Sanders Kaufman)

So I'm doing it right?! Cool.

It always depends on what you want to achieve. From just looking at the
posted snippet and without knowing what the my_baseclass is supposed to
do, it's hard to tell whether you're doing it right or not, since the
code is not doing anything useful, except for initializing some member
variables.

I know there are some cases where you're
supposed to serialize objects instead of... what am I doing, passing by
reference? Instantiating?

Aggregating. ;) You create an instance of a class, which is used inside
another object. That's it (in this case).

Serializing can be used if you want to store an object to a file or a
database.

Micha
.