   Network Classes Organization
  While my game already has some networking implemented, i would like to clean it up and organize it, since it very messy right now IMHO. Here is how i'd like the new layout to go. The current system has just one big class that does everything and is hard to debug. please tell me if this looks good and perhaps also how you would do / have done it in your own projects:Here is the class inheritance diagram for a C++/SDL_net networking system for my game, with short explaination afterward:NetworkCore.   .    ..   .  .    ServerCore ClientCore   |   |   |   |   |   |ServerGameNetwork ClientGameNetwork.    . .  .  ..  NetworkNetworkCore: (basic functions: send(), receive(), etc)ServerCore: (core functions to run server)ClientCore: (same for client)ServerGameNetwork: (game specific functions for server)ClientGameNetwork: (same for client)Network: (the whole package. the actual class used by the game interface.)Does this look okay? I thought this way it might be better since i can take the code and remove the game specific classes and re-use the whole thing someday. I plan to have just the Network class for actual game usage with all it's functionality provided by it's parent classes, regardless of whether i'm playing as server or client. Is there anything you might do differently?[edited by - leiavoia on February 10, 2004 10:05:28 PM]
  Don''t use "is_a". Instead, use "has_a" or "talks_to_a" or "acts_on_a". Use subclassing only to implement abstract interfaces, and only pass abstract interfaces (not concrete classes) to other classes (which, by corollary, you will only see as interfaces).