Well there are lots of advantages to using
Value objects rather than overriding
Slider::Listener and i.e. calling a method of your AudioProcessor class. Perhaps most importantly, assuming the relationship between the slider and the ValueTree is simple (the slider modifies only one parameter and does so in a predictable way) it takes considerably less code to attach a slider to a value tree with a value object. It is also normally quite easy to debug and modify these relationships later.
I’m assuming that you’re talking about a plugin here, and although the pattern I’m going to mention works even if you aren’t using one, it’s definitely geared towards plugins.
The best, most idiomatic way to attach a slider to a parameter, assuming that parameter is in an
AudioProcessorValueTreeState, is to use an
AudioProcessorValueTreeState::SliderAttachment, which basically does what you’ve done automatically and keeps the slider and the parameter it changes in sync.
None of these ways is wrong per se, and there are moments where you will need to derive from Slider::Listener to modify parameters in some custom way, but generally if it can be avoided it reduces clutter and incurs no overhead to use an attachment.