M
mem
Class subject
{
private:
List<Observer*> *_observers;
....
};
Why use a pointer, _observers, above?
Is it really necessary to have Subject and Observer base classes in the
pattern? Instead, just pass a pointer of a class into another, and the
latter just informs the former by calling its member function, whenever
needed?
How to assign _observers to a List object?
Thanks!
{
private:
List<Observer*> *_observers;
....
};
Why use a pointer, _observers, above?
Is it really necessary to have Subject and Observer base classes in the
pattern? Instead, just pass a pointer of a class into another, and the
latter just informs the former by calling its member function, whenever
needed?
How to assign _observers to a List object?
Thanks!