For example, there is a repository class that goes to the REST API, receives JSON and parses it into the necessary structure, then puts the data into the cache (let it be SQLite). In fact, I have one method in the repository, for example:
Message[] getMessages(int offset, int count) So, it seems like one duty, but how to perceive the fact that in the implementation of this method a class can go to Http, Knows about the data format and knows how to parse Json, and also knows that there is a cache with different rules for each method and you need to put something in it.
What to do with such methods? Even if I hide access to Http and parsing with the cache for additional abstractions, it will not hide the fact that the repository still knows about the method of obtaining that the received data should be parsed and cached. In fact, I will have to touch the repository if access to data changes, for example, from Http, to Sqlite, if the data format changes from json to xml, or to Cursor from Sqlite, or I need to cut the cache.
Is the SRP principle broken or not here?