I have a task, namely, you need to make an application that allows you to export data from MS SQL Server NorthWind database tables by performing arbitrary user SQL queries. And you need to lay a logical structure that allows you to easily carry out its further development, modification and scaling. A question from me, I will not describe what this will all be in the mvvm pattern, but I see this application logic. There is a class Controller, it has two methods. First Send_Inquiry_in_Base (). The second Display_query_execution_results () I want to make this method of displaying the request so that I can if I need for example to send data to a csv file or another format. And accordingly the class Data__csv, which writes the result of the query in the file. Actually the question itself. How to make a universal connection between the Controller class and the Data_в_csv class so that, if necessary, I did not change the controller, but add the class I need for the output, that is, now this output in csv and then it can be used for something else, how can I implement it? Is it through the interface, or is it some kind of container to do?

  • You ask what the specific 2 words mean in your technical specification? Why not ask it from those who gave you this TK? - tym32167
  • If I understand correctly, then you ask about design patterns, google singleton, MVC, MVP, MVVP, and so on. and understand what you need. I think you fit MVC, or MVVP. But if you do not know that it will be difficult. - Dmitriy
  • @Dmitriy Thanks for the answer, but I know what MVC is and so on. I think that we need to provide for the possibility of adding new requests, changing the code. - Vladimr Vladimirovoch
  • one
    so that if necessary I ... add the class I need for the output - a plug-in system. A simple implementation method is described in Richter CLR via C #. Also google in terms of MEF, MAF. - Alexander Petrov
  • one
    Yes, you can not even recompile (and not restart) the main application. Just write the plugin / addon and put the resulting lib in the desired application folder. After which it will be possible to use it (by selecting, for example, in the dialog box, etc.) - Alexander Petrov

0