I have three layers. I wish to reduce coupling between them and other modules. I wish to use the command pattern between all layers. A command should be able to be passed from one layer to another. For this, all layers must have implementations of the same set of interfaces, for example the command interface.
I'd prefer if the layers do not depend on some global module that defines shared classes and interfaces. Is this unrealistic? Is there a neat manner in which multiple layers can implement the same interfaces without depending on some global module at runtime?
Maps
or object arrays. Or serialize inputs and outputs to byte[] or strings. But then you need serializer and deserializers.