This is the OO design of Q. I am using Configate Config in my application. The Config interface is very useful, but there are several fields in my applications; configuration file, which is required. I would like to create a subInterface Config and add these 2 top level methods. Something like that
trait AppConfig extends Config{ def param1:String def param2:String }
However, creating a real instance of AppConfig based on the Config instance is not possible (I do not want to create a wrapper object and duplicate all methods in the Config interface). Ideally, Im looking for something that will achieve something close to this.
val conf:Config = //get config object from somewhere return conf with AppConfig { overrider def param1 = {"blah"} }
I understand that the last line is invalid. But Im looking for a template / construct with equivalent functionality.
source share