0

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:

  1. Having a top-level /api/exports/ and /api/imports/ package followed by <vendor>
  2. Having a top-level /api/ package followed by <vendor>/exports/ and <vendor>/imports/
  3. Having a top-level /api/ package followed by <vendor> with no specific exports or imports package, but rather a mixture of everything in it
  4. Having plain feature packages (no top-level /api/, where the vendor name equals the feature name, containing exports and imports directories
  5. 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?

3
  • can you explain exactly what you mean by package and feature here and why they relate to your http paths?
    – Ewan
    Nov 20 at 14:32
  • @Ewan sorry, I did probably not express myself clearly enough. I'm not relating to any HTTP paths with my post but to the package structure within the project source and the package-by-feature way of grouping your classes instead of package-by-layer. However, one could argue that what we currently have is a mixture of both. Nov 20 at 14:50
  • so you have subpackages? what language are you using and what are your vendors, does each vendor use different code? Obviously if you stick with one or the other approach you are going to have edge cases, but without knowing the details I'm not sure i can advise
    – Ewan
    Nov 20 at 21:28

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.