Watson icon indicating copy to clipboard operation
Watson copied to clipboard

Decouple config and watson api via dedicated value object

Open hiiwave opened this issue 6 years ago • 0 comments

Follow #320, there might be future plan to support calling watson api as a library. As currently watson.watson has strong coupling with watson.config, it's not yet ready for such usage case.

IMHO, a better design will be creating a class WastonOption serving as a value object (with default values defined), and it can optionally sync with the config file. For instance, in Watson.add it will become default_tags = self.options.default_tags instead of current default_tags = self.config.getlist('default_tags', project).

I'm posting this mainly for future reference, as this involves some non-trivial refactor process without urgency.

hiiwave avatar Oct 01 '19 15:10 hiiwave