Questions tagged [multiple-dispatch]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
109 views

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, ...
1
vote
2answers
222 views

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&...
0
votes
1answer
97 views

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 ...
7
votes
1answer
474 views

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 ...
2
votes
2answers
298 views

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 ...
7
votes
3answers
1k views

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)) ;;...
15
votes
1answer
4k views

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: ...