An example of Dynamic Dispatch, is say you create a Class object of a person. And you give that object the method ‘jump’.
Then, you create say 30 persons, one for each student in your classroom. Then, you collect them all into a list. And you iterate through that list, and tell each person to jump.
So in Python, it might be something like:
John = Person()
Jane = Person()
# then create 30 of them students
student_list = []
student_list.extend([John, Jane, ...])
# Then make them all jump.
for kid in student_list:
kid.jump()
So, per my understanding this is what Dynamic Dispatch is. It allows you to reassign a variable to an existing set of objects, and to massively activate all of them. Such that, you’re sending an execute command to all of the associated objects.Was this the genius innovation to OOP, as opposed to procedural languages before it? And can something like this be simulated in other imperative or functional type of programming languages?