D
D
Dair_Targ2011-11-24 09:32:41
Qt
Dair_Targ, 2011-11-24 09:32:41

Is it true that the signal and slot mechanism is trying to make up for the shortcomings of the architecture?

When using C++, there are many frameworks (Qt, boost, ...) that implement the signals and slots mechanism in one way or another. However, this mechanism is not the simplest.
When used incorrectly, it smears the logic of the object's behavior. For example, instead of directly calling one method B from another method A , the called method B is bound to the signal sent at the end of the first method A .
On the other hand, signal slots allow fair message sending and multi-threading while hiding implementation details such as event loops and message queues.
What can you say for or against the use of signals and slots?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
stepank, 2011-11-24
@Dair_Targ

I speak from experience with Python and JavaScript. in some frameworks, there are also ideas similar to slots and signals, they have two convenient leads:
1. one event (signal) can have several handlers, this has already been called
2. the sender of the signal may not think about who will listen to it, and will listen at all

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question