J
Josh Mcfarlane
I've create a base class for Packages that I am sending via TCP/IP, and
then deriving the different transport classes from this base class.
Now I can recreate the classes on the other end with the correct class
type, but each package will need to be passed back to a different
handling function that is not known to the transmitting program, and
may change.
Here's my question:
How should I implement handling the routing of the package on the
receiving program? I could use a switch statement to route them, which
would solve the problem, but defeats polymorphism and is evil.
However, if I add it to an overridden function such as Route() to the
Package class, it adds a dependancy to other files that the client
program may not have.
How would you pros go about handling this situation?
Thanks,
Josh McFarlane
then deriving the different transport classes from this base class.
Now I can recreate the classes on the other end with the correct class
type, but each package will need to be passed back to a different
handling function that is not known to the transmitting program, and
may change.
Here's my question:
How should I implement handling the routing of the package on the
receiving program? I could use a switch statement to route them, which
would solve the problem, but defeats polymorphism and is evil.
However, if I add it to an overridden function such as Route() to the
Package class, it adds a dependancy to other files that the client
program may not have.
How would you pros go about handling this situation?
Thanks,
Josh McFarlane