Answer the question
In order to leave comments, you need to log in
What pattern to use?
The task is this:
There is a certain application, some of its module works with dynamically connected plugins and itself performs some other task.
Plugins work and return some structure as a result. Plugins can use each other, even cyclically. Those. one plugin can call another as an assistant (or maybe several, depending on which ones are available at the moment), and that one, in turn, is the third plugin or even the first one.
The structure of the application is as follows:
I can't choose a pattern, such that further writing plugins, and maybe expanding the interface, does not turn into torment. How to implement correctly ?
I write in C++/Qt
Answer the question
In order to leave comments, you need to log in
It is necessary to specify the requirements, namely:
It seems to me that in this case it is necessary to use the "Strategy" pattern .
Strategy, Strategy - a behavioral design pattern designed to define a family of algorithms, encapsulate each of them and ensure their interchangeability. This allows you to select an algorithm by defining the appropriate class. The Strategy pattern allows you to change the selected algorithm regardless of the client objects that use it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question