Background
I have an interface defined for a circular-buffer called ICircularBuffer
in a separate project. This ICircularBuffer
is something that we use all over the place, so it resides in the CommonInterfaces
project.
Well, we have another interface IEquipmentController
that controls some very distinct piece of equipment. This piece of equipment produces some data. I would like to pass my buffer to the IEquipmentController
so that I can read the buffer asynchronously by reference from the thread that passed it.
The problem is, that the IEquipmentController
and ICircularBuffer
are defined in two separate projects. So this leads me into my question...
Question
Because of how the CommonInterfaces
is used all over the place, is it okay for my IEquipmentController
's project to take a dependency on the CommonInterfaces
project?
Alternatively
Maybe I can have the concrete EquipmentController
take the dependency on the CommonInterfaces
... and then just have the IEquipmentController
define a method that accesses the buffer? Thus remaining ignorant to the implementation details (and avoid passing by reference altogether)? I guess this way the two interfaces (IEquipmentController
and ICircularBuffer
) wouldn't get tied together.
What is my best option here? And in general, are there ever situations where it is a good idea for an interface to take a dependency on another project just to access another interface?