5

I'm writing a program that has one class called Driver, which reads audio, sends it through an effects chain and then sends it to an audio output. The effects are created from dynamic libraries (using either LADSPA or LV2 interfaces). So I wrote a class called DriverMediator that manages the shared libraries that contain the effects, and the Driver class that uses the effects.

So is this a correct use case of the Mediator Pattern?

asked Mar 12, 2017 at 19:49

1 Answer 1

0

The mediator shall encapsulate the interactions between colleagues. The intent is to have a loose coupling between the colleagues.

It is not fully clear from your description if you use it rightly. May be you do, but your description gives the impression that your DriverMediator just encapsulates all these objects and act as a kind of facade:

  • do the Driver and your LADSPA/LV2 plugins all know the mediator and are capable to interact with it ?
  • is the Driver independent of the libraries ? Fo example, could you replace the libraries with completely different audio systems and still do not change the Driver ? Or does the DriverMediator just forwards the calls, leaving the Driver indirectly dependent of the library ?

If it's still unclear, you could edit your question to give additional details about the interactions between all these objects.

answered Mar 12, 2017 at 20:49
1
  • it sounds like I was using more of the facade pattern, after reading about it and reading your answer. I'm just going to rename DriverMediator to DriverFacade Commented Mar 12, 2017 at 21:05

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.