Make UrlConfig a subclass of HashConfig
A `UrlConfig` is a `HashConfig` that mixes in connection information
based on a `url` passed from the constructor.
Previously, for each new property we wanted to introduce an accessor
for, we'd need to write an implementation for `HashConfig` _and_ for
`UrlConfig`.
Now we make `UrlConfig` descend from `HashConfig` so we can write a
single implementation for both cases.
Also while we're in here, take the `adapter` implementation into
`HashConfig` so that `DatabaseConfig` isn't making any assumptions about
the structure of its subclasses.
Co-authored-by: Neileencodes <eileencodes@gmail.com>
Showing
想要评论请 注册 或 登录