[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: C++



On Mon, 2003-02-24 at 09:35, Thomas Dodd wrote:
> I check the C++ books I had lying around and couldn't find forward 
> declaration.
> 
> After the mention here, I was looking at some other code and saw it used.
> Now, why didn't I see that in the code before? :(

Because an important aspect of good OO design is to keep classes as
loosely coupled as possible.  Having two classes directly reference each
other like you described indicates a potential refactoring may be
needed.  

A good book to consider reading is "Pattern Hatching" by John Vlissides;
his initial example of designing an OO filesystem abstraction sounds
very similar to what your example was trying to solve, only he
demonstrates several ways that design can be improved and why those
changes are necessary.

Tom





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]