Reasons to store interfaces and implementations in separate packages:
clear code base . It looks โbetterโ, more accurate if we have one package with interfaces and another with implementations (usually something.impl namespace). And the code structure shows / reflects what you code against interfaces.
access modifiers . We can use package private access modifiers for the package private API to implement related interfaces.
The structure of the library . Perhaps one day you may decide to create different libraries for the API (s) and implementation (s). Then itโs nice to have interfaces and implementations in different packages. Thus, you can change the assembly without refactoring your code base.
Andreas_D
source share