Fork me on GitHub
#component
<
2016-08-31
>
donaldball15:08:27

Has anyone else done anything structured around validating components’ configurations? My usual approach is to validate the config values types before building a system, but to defer any run-time validation (e.g. the server is up and accepts our credentials) to the start method, where I just raise for problems. Needless to say, this doesn’t present a good UX. I’m trying out a Validate protocol now, where components can report anything that stands in the way of them being able to start, with a utility fn that walks up the tree collecting errors as far as it can go.

donaldball15:08:48

This feels like a common problem, so I’m curious what approaches others might have used.

seancorfield16:08:48

We’re about to go down the path of spec’ing our components so we may be wandering about in that territory shortly, but I don’t believe we have much possibility of "bad configuration" in the way we set things up so I don’t know what our experiences will be — or whether they’d be relevant to you @donaldball

donaldball16:08:54

I’m thinking more along the lines of “password is not accepted” than “password is not a string”, though both are germane problems to present to the operator