What is Single and Double Dispatch?
i have wrote the visitor pattern as follow but i don't understand what is single and double dispatch. AFAIK, single dispatch is invoke a method based on caller type where double dispatch is invoke a method based on caller type and argument type. I guess double dispatch is happen in single class hierarchy but why visitor class has two class hierarchy but it still considered as double dispatch. void floppyDisk::accept(equipmentVisitor* visitor) { visitor->visitFloppyDisk(this); } void processor::accept(equipmentVisitor* visitor) { visitor->visitProcessor(this); } void computer::accept