I have an object, an in-memory data provider, which contains a lot of data. The dilemma I'm facing is how to get other objects to use this data without passing them the data provider. I would like to keep objects and their methods, that use this data, as decoupled from the data provider as possible. But I'm also not able to extract the needed data and pass it to objects. I was thinking of creating some helper classes with very restricted functionality, wrap the data provider inside, and pass them around. It this a good idea or does anyone know better? Refactoring the methods, so the needed data can be extracted from the data provider, before passing it to the methods is actually an option, but it would require a lot of work.
Aucun commentaire:
Enregistrer un commentaire