Questions tagged [multiple-dispatch]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2 votes
2 answers

How would dispatch work in the Wizards and Warriors "rulebook"?

In Part 5 of Wizards and Warriors, the blog proposes the concept of a "Rule" and rulebook to address the issues with solutions in the previous parts. One of the issues was the need for ...
justin's user avatar
  • 49
0 votes
1 answer

Any tradeoffs for using open methods?

I was trying to understand the use of multi-methods recently and saw several claims that they solve the Expression Problem. However, I ended concluding that it is not the multi-methods that solve it, ...
Nemanja's user avatar
  • 119
2 votes
2 answers

Are multiple dynamic dispatch methods possible?

C++ only supports single dynamic dispatch methods. Indeed, the following program: #include <iostream> struct Shape { virtual void overlap(Shape* y) { std::cout << "Shape, Shape\n&...
Géry Ogam's user avatar
0 votes
1 answer

Does this architectural design "smell" like Service Locator and can this be dealt with in a more robust manner?

I have an architecture based on a domain with multiple object types. These objects (many and of disparate types) must reside together with each other because they make up a use-case. The types are not ...
Vector Zita's user avatar
  • 2,392
7 votes
1 answer

How to tackle extensibility considering the Data/Object Anti-Symmetry?

In Clean Code by Uncle Bob, page 124-125 he states Procedural code (code using data structures) makes it easy to add new functions without changing the existing data structures. OO code, on the ...
Jp_'s user avatar
  • 189
2 votes
2 answers

Strategy for implementing Multiple Dispatch

This is a question regarding how Multiple Dispatch works. Suppose that we have a type hierarchy like this: Drawable -> Shape -> Polygon -> Rectangle And there are three functions (This is ...
Mahdi's user avatar
  • 179
7 votes
3 answers

Understanding Multiple Dispatch

I've been reading around trying to understand multiple dispatching, and why it's so special. On Wikipedia I came across this simple example: (defmethod collide-with ((x asteroid) (y asteroid)) ;;...
Electric Coffee's user avatar
18 votes
1 answer

Multiple Dispatch vs. Function Overloading

I'm trying to understand the difference (if any) between the two. According to the Wikipedia page for Multiple Dispatch it is synonymous with Function Overloading, but then later on goes on to say: ...
KaptajnKold's user avatar