M
M
Max Maximov2017-05-31 16:58:03
ASP.NET
Max Maximov, 2017-05-31 16:58:03

How to take out the logic of work in separate .dll? And what is it called?

Given: a web service for sending data to WebAPI with a customer base. Each client receives mailings according to his own requirements (protocol, data fields, sometimes it is even required to send a file (.xls, .mdf, ...)).
Necessary:

  1. Move the business logic for generating a report request for each client into a separate .dll
  2. Since the web service sends a newsletter every 2 minutes, you need to fasten the scanner .dll-ok for a specific client. To make it easy to change them, without restarting or stopping the application.

The option with additional fields/tables describing the requirements of clients and writing a separate function is not suitable. Because everything has to be taken into account. It may be that a new client will appear and say, so I want to receive data in .xls/.mdf/.dba via POST/proxy and so on. Therefore, such a flexible architecture is needed, where you do not have to take into account everything. And everything is added as a separate function to the .dll for the main web application if necessary, that is, when such a client with certain requirements appears. There is no reason to write the logic for generating a report for all protocols, files and other requirements now.
I ask you to suggest a solution to this problem and share the name of this type of architecture. Or suggest an alternative solution to this problem. So that you don’t have to endlessly re-deploy the application, but replace .dlls for each client if necessary.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Peter, 2017-05-31
@maximka19

For .NET, there is only one option to update a dll, and that is AppDomain.
In your case, you create new ones for each unique scenario, and if the dll changes, unload the entire domain and create a new one.
Of course it's not entirely clear from your description what exactly you want. But I will assume that Workflow is more suitable for you when you break everything into small tasks that you can already put in a dll, and then simply describe the scenario.
7c056f1079b8439dbdcf334eed9c9d55.PNG

O
Ogoun Er, 2017-05-31
@Ogoun

Especially for these purposes, enter the standard libraries MEF
. This is much easier than writing your own host applications based on the AppDomain.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question