Answer the question
In order to leave comments, you need to log in
How to properly split a project into modules? And how to properly organize the connection between them?
Hello!
I just can't figure out how to make a site based on loosely coupled modules, and therefore I decided to try it through practice on a test project. I would appreciate any advice.
Let's say there is an electronic library website. There are books , book category , authors , users and user comments .
Answer the question
In order to leave comments, you need to log in
Good afternoon.
one
two
This is for starters, the rest in other blog articles.
ps
Organization of portable modules
Links of independent modules
The question is very important and complex. The division of the project into modules can be influenced both by the processes in the modeled business and the organizational structure of the development team (see "Conway's Law"). And if the second can (potentially) be changed according to needs, then the first must at least be clarified. The ability to make changes to business processes is usually limited, but in any case, you need to understand the actual state of the subject area.
In recent years, the Event Storming technique has been developed. There are already many videos on this topic and even a book [half] ( https://leanpub.com/introducing_eventstorming ). The key idea is to figure out what needs to happen before we get into any known state. The technique is of particular interest in the context of microservices. Offeroxidmod also has a lot to do with this.
But in addition to the system level, you also need to modularize individual components so that you can put them in your head, test and develop independently of each other. The Hexagonal Architecture (also called "Ports and Adapters") will help you here. This concept will help to divide the component into parts that implement business functions and (separately) external interactions: with the file system, with the database, with HTTP client-services, etc.
At an even lower level, I advise you to master 1) separating pure functions from effects and 2) functional composition - these are ideas from functional programming. I don’t know how with FP in PHP, but here practicing PHP programmers can tell.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question