Answer the question
In order to leave comments, you need to log in
Modularity of a php application (on the example of an online store)?
For example, there is an engine for an online store (blog, forum, whatever). It has the following modules:
Catalog - in fact, the product catalog itself
Cart - shopping cart
Order - module for ordering goods
Pages - information pages
Payment - module for working with the API of various payment systems
Search - product search
Users - registration/authorization
Wishlist - user wish list
Purpose :
Full control of the store. Would you like to make a catalog of goods from the store? Just disable the registration module and the order module. Or, for example, a "simpler" store: we leave the module of the catalog, basket and ordering goods.
There are following problems:
1. Dependence of modules from each other.
Simple example:
Cart depends on Order , Order in turn depends on Payment . At the same time, neither Order nor Payment can work without Cart (unless you order a product in one click). Alternatively, you can write module dependencies in a separate file (something like composer.json) and disable/remove dependent modules when you disable/remove the module they depend on.
2. Problems with the interface (layout, themes)
Main problem. Disabled registration (basket, search) - you need to remove the links in the header. So the layout can fly. Or the theme does not support the required module.
Questions:
1. Is it possible? If not complete, then at least a weak dependence of the modules on each other?
2. Is it worth it?
3. What are the ways to reduce the dependence of modules on each other? Only the event model comes to my mind.
Answer the question
In order to leave comments, you need to log in
At the same time, neither Order nor Payment can work without Cart
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question