Does interface segregation principle apply to configuration data holders?

  softwareengineering

If you have a class representing your applicative config file.

Instead of injecting that config class everywhere, would it be good application of interface segregation principle to expose several interfaces (based on config sections ?) on the class and inject them one or several of those to the consumers of that configuration (real implementation having only one instance).

I was thinking it would help quickly read which actual bits of configuration matters for a specific module, and make things clearer by only exposing relevant bits of config to each module.

Is it overthinking ISP ?
Does ISP apply to data class ?

LEAVE A COMMENT