c# – Where should a static class not associated with either Models or ViewModels be located?

Question:

I'm learning MVVM. After going through several toolkits, I settled on SimpleMVVM

With the toolkit itself in its basic basis, it seems to have figured out, but the question arose. There is an application that scans files of a certain type in a given directory, reads a description from each and creates the corresponding xml file. Then a selection is made from this xml-file according to the required parameters and displayed on the screen. At the moment, directory scanning is done as a static class with two methods:

public static class Scaner
{
    public static int NewScan() {...};
    public static int Rescan() {...};
}

In the future, it is planned to create another similar static class – a converter from one format to another.

The question is: where should these two classes be located if they do not belong to either Models or ViewModels (at least as far as I understand), and how to call them correctly?

Answer:

If the project is small, you can place this class next to the class(es) where it is used. If the project is large, then, as a rule, it is divided into parts according to the area (for example, UI , TextProcessing , ImageProcessing , etc.), so you can take it into a separate subproject ( Scanning ).

Scroll to Top