ForNeVeR / nightwatch

Stays alert while you sleep.
MIT License
6 stars 0 forks source link

#4: add resources #13

Closed ForNeVeR closed 7 years ago

ForNeVeR commented 7 years ago

Architectural solution

  1. We'll have two additional assemblies: Nightwatch.Core and Nightwatch.Resources.
    • Nightwatch.Core is a common assembly that's intended to be used by all the (potentially third-party) Resource libraries
    • Nightwatch.Resources is a default Resource assembly (should be optional ideally)
  2. Each of the resource types should have its' ResourceFactory definition that builds the checker function from the parameters passed from the configuration.
  3. Program module loads the default Resources from the Nightwatch.Resources. Later we could wire up additional used-supplied Resource assemblies there.

Resource configuration

For now, I've decided to implement two Resource types:

When authoring the configuration, user should explicitly state type: xxx in each of the configuration files.

Each Resource could have its own parameter set, defined by param: configuration attribute. That'll be a simple key-value map parsed by the Resource factories.

There're sample configuration files for each resource type in the samples directory.

Remaining work

Impact

Closes #4.

ForNeVeR commented 7 years ago

@gsomix wanna review?

gsomix commented 7 years ago

@ForNeVeR Yes.

ForNeVeR commented 7 years ago

Thanks for the review!