0

Module

We're creating a webshop and are mostly creating every file we need in app/code/vendor/module right now. This means we have lots of different features like widgets and logic for multiple different things in one module. This ends up becoming quite a mess of code specifically developed for the current webshop.

We've been wanting to take a more modular approach to developing in Magento and we were wondering whether it's better to split all different features up in different modules under our own vendor folder?

If someone has any examples of how such a project should look it would be greatly appreciated!

2 Answers 2

0

Split it up into isolated modules for specific functionality/responsibility.

For example if you have an external service ERP that handles your product data, orders and customers, you may eventually move away from that service and it is much easier to remove a single module than to untangle from a large module that does everything.

1
  • Great answers and absolutely true from what I've seen so far. Both you and Abdul Samad Abbasi describe different situations which need to be taken into consideration before deciding whether to split things up or not.
    – Alphaegen
    Nov 17, 2020 at 12:09
0

Magento2 already forces you to make remarkably huge number of files(for a single module) for a strict MVC implementation, so if you make more than one modules for implementing relatively smaller tasks, I think it's gonna over-complicate things a bit more for you since you'll have to manage more than one modules with such huge number of files. Magento doesn't provide much flexibility, and you need to become used to of that. :)

1
  • Great answers and absolutely true from what I've seen so far. Both you and Craig describe different situations which need to be taken into consideration before deciding whether to split things up or not.
    – Alphaegen
    Nov 17, 2020 at 12:09

Your Answer

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

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