Add Helpers and usecases in ViewModel is valid or not?

from the CommonsWare Community archives

At February 27, 2020, 10:00am, islam.farid2100 asked:

An Architecture Question Please.
From your view do you think it is a good idea to inject a helper class in the view model which is not a usecase.
Forexample, I have a viewmodel for a view that displays horizontalList of People, and every period of time I update this list of ppl and display a toast for the removed one and also for every new one I display a toast. I would like to do the comparisons in a helper class and inject it in the ViewModel, and the reason for that is I really have a very big business in this view, so I wanted to split the responsibilities, so in the same view I have also different horizontal list for items which I am calculating the prices and changing them as well and for this I created ItemHelper. Therefore, is it valid to inject two or more Helper objects beside the injected usecases in the viewmodel?.

Please let me know if the question is not that clear. Thanks in advance :slight_smile:


At February 27, 2020, 12:23pm, mmurphy replied:

Let me try answering this in stages…