0

Currently i am handling placing my services by their action type like

  • App
    • Services
      • Storage
      • Payments
        • Providers
        • Gateways
        • IpnHandler

But i felt like whenever our payment providers are growing i have to check Gateways / IpnHandler. And i felt like payment gateway should only care about payment and its result. But i am not quite happy about this structure so that next alternative came in my mind was this

  • App
    • Services
      • Storage
      • Payments
        • Paypal
          • Gateway
          • IpnHandler

So how one should structure their folders ?

1

I wrote an article last Christmas called "Happy Packaging" (suitable for this holiday season also:).

In that I detail 3 simple rules to keep packages organized, to be able to find things, and to keep it maintainable, i.e. to keep changes localized as much as possible:

  1. Packages should never depend on sub-packages.
  2. Sub-packages should not introduce new concepts, just more details.
  3. Packages should reflect business-concepts, not technical ones.

In your case the 3. rule is broken for sure. You organize per technology and that splits up things that belong together logically. So my advice: get rid of all technical concepts in the package structure and focus on the business logic, let the "business" dictate the structure.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.