I work with VK Api for general development, understanding of Api in general. And all the graphic components (creating models for messages, etc.) are done directly in the methods that send a request and then receive a response.

Should we make a separate class responsible for creating models or is it better to leave it behind the methods that execute the query? Will it be more effective / not?

  • It is necessary to reformulate the question so that it can give an objectively correct answer - AK
  • What exactly you do not understand? There is a class that is responsible for requests for messages (Messages). The methods in it are called similar to the requests that they perform to the API itself. For example, getHistory. Inside the method, HttpRequest from xNet, makes the request and receives the response, and Newtonsoft.json performs the parsing Then a cycle is created in the same method that creates message models for usercontrols and at the end passes the generated collection to the correct class responsible for the VM for the chat page. Later, this collection will bind to itemscontrol from the datatemplate as usercontrol. - Ricarnev 2:57 pm
  • 2
    This is from the category "I need the code of a footcloth or not." As you think, it is more convenient when everything is mixed in one method and as a result you have 1 class with 10,000 ++ lines of code, or are divided into objects, classes that have their own local management methods and as a result you have 30 classes with 100+ + term code each? - EvgeniyZ
  • It is clear that no one needs the code of the poratnka. I’m more interested in the effectiveness of this approach. The effectiveness of the fact that the mediator class appears in the chain from receipt to output. The difference is minimal, or noticeable, I would like to know. - Ricarnev 3:12 pm
  • one
    It saves on matches. - EvgeniyZ 3:14 pm

0