Dear all
This was on my mind for a long time ( removing packet.payloadDescriptor() and switch/case statement … )
OO recommends removing this … So what is the solution?
This is where the Visitor pattern ( GOF ) fits very nicely…
So I put in the Visitor framework and made
PacketProcessor::packetReceived
a visitor….
Here is the patch…
Let me know what you all think…
( One nice fallout is if we add any new packet the compiler will help us make sure all the relevant code gets updated ;-)
— cheers atul
