An interface states a method contract while an implementation supplies behavior. Any object satisfying the interface can replace another without changing the caller.
The demo routes Storage.save to memory and file implementations in turn. Keep contracts focused so implementations do not carry unrelated methods.
When to use
Use it to swap storage or transport dependencies, including test implementations.