Answer the question
In order to leave comments, you need to log in
Inter-module communication in extensible applications?
Hello. Please push in the right direction! There is an abstract understanding of the issue, but there is no desire to write another bicycle, because. there are probably some well-thought-out standards or frameworks that I can’t find.
Purpose:
The idea of such a plan. There is a host application that loads the given modules, bringing the final application to the final form.
Example: A module processing temperature data, a module processing pressure data and a communication module through which communication with the outside world is carried out (let it be a TCP server).
Those. the output is a valid weather server from which the user can take some data. As a result, the application due to the modules can become ranging from a calculator to a mission control center.
Questions:
1. How can I communicate between modules so that it is incoherent. Let's say the client sends a request to get the temperature value, the server module, having received this request, must somehow pass it on to the request processing module, which in turn will contact the requested temperature module to get the value, etc.
Heard about message systems, RPC.
2. Tell me about the actual frameworks in the area consecrated above, which can help me and about which I can at least read in order to deepen my understanding of the issue.
Thanks a lot!
Answer the question
In order to leave comments, you need to log in
I'll try to be specific, I'm interested in the interaction between modules in the application itself.
There is an application (kernel/host) that loads modules (.dll) that describe various logic. These modules, of course, somehow need each other's functionality.
Those. if I were making a monolithic application, I would explicitly take the necessary functions from the libraries and somehow use them.
In the current case, this approach is not suitable, because. the kernel must dynamically load modules that it knows nothing about. Those. you need to abstract with interfaces, for example, through the intermediary pattern, or create some kind of message system that other modules will respond to and somehow respond to. This is where my misunderstanding begins due to a lack of knowledge on how to tie it all together and implement it.
Those. How can I allow from a UI module, by clicking on a button, to affect another module when the links between them are implicit . When I ca n't stupidly instantiate module A in module B and call some function.
If it is not clear what I wrote, I'll try again :)
------------------------------------ ------------
In general, that solution was found through MEF. I thought that the framework itself will link all links between all modules where there are necessary contracts, but it only links between the host and the modules where the composition is performed. I solved the problem by re-search for the necessary contracts in plugins that need their own extensions, and the next composition is already in the plugin itself. Those. The plugin also acts as a mini host for its extensions. If there are any corrections or ideas, I will be glad to hear from you, Thank you all! :)
PS: Magic happened and everything began to link as I need without dancing with a tambourine. Wonders...
Judging by the problem, there are three disconnected areas.
The first is communication between applications on full-fledged devices. Usually these are REST APIs and general purpose backend frameworks.
The second is communication within a complex system. These are queues, like RabbitMQ.
The third is the communication of full-fledged devices and "smart" ones. For example, MQTT.
To understand. how to help you, I would like to see a more specific question. Now your problem is not clear.
The closest it can be called plugins.
In .net there is a wonderful thing mef
And for the general case - well, apparently it is worth creating a certain mini-template for the interaction of the loading level of these same plugins, passing them a minimum of parameters and transferring control.
More flexible interaction - well, either turn or ready-made implementations.
Nah, integration via MESSAGES is not so easy, it is mostly required in large enterprise applications where there are many applications between which you need to configure the interaction.
In your case, everything is much simpler in order to break the monolith into separate modules. There is a pattern called "Plugin" which is described in Fowler's book on Enterprise Application Patterns.
I would do this: I created a separate project, where the module contracts are given, i.e. software interfaces. Well, then in other projects, these contracts / interfaces are implemented ...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question