architect-handbook

Software Architect Handbook

View on GitHub

Separated Interface

Defines an interface in a separate package from its implementation

Overview

You might need to invoke methods that contradict the general dependency structure. If so, use Separated Interface to define an interface in one package but implement it in another. This way a client that needs the dependency to the interface can be completely unaware of the implementation.

How It Works

Esentially the client package indicates that it will work with any other package that implements the interface it defines.

When to Use It