We are generally following the package-by-feature approach, which is great.
However, one specific case is constantly causing confusion and inconsistencies, and I'd like to know your approaches in this regard:
Packaging API implementations that import, export or import and export data (by feature)
We have had multiple solutions to structure our classes in packages so far:
- Having a top-level
/api/exports/
and/api/imports/
package followed by<vendor>
- Having a top-level
/api/
package followed by<vendor>/exports/
and<vendor>/imports/
- Having a top-level
/api/
package followed by<vendor>
with no specificexports
orimports
package, but rather a mixture of everything in it - Having plain feature packages (no top-level
/api/
, where the vendor name equals the feature name, containingexports
andimports
directories - Having plain feature packages (no top-level
/api/
, where the vendor name equals the feature name, containing an/api
package
How do you deal with external APIs in your project structure, that either import or export data or do both?