'Which clean architecture layer belongs a string provider to?

We are building an Android app and some time ago we started to introduce Clean Architecture. We have a StringProvider class, which is a wrapper over an open-source library that provides us the strings (so it can be mocked for our unit tests).

class StringProvider {
    fun getString(key: String): String
}

The question is at which layer should this StringProvider class live.

Some of us think that it should live at the data layer, as it behaves as a repository of strings, so it can be used by the domain layer. Some of us think that it should live at the presentation layer only, so string provision/manipulation only happens in there. Some of us think that it should traverse the whole layers, so it can directly be used in domain and presentation layers.

Which layer does the StringProvider belong to?



Solution 1:[1]

If this is needed by your domain layer, domain layer should rely on an interface. Then you can inject any concrete implementation into the layer.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 bhiku