I have worked with a lot of projects which was written by usual "everything in controller" way and when they become to grow their support complexity grows exponentially. Sometimes developers tried to move code to helper classes, but it doesn't help a lot. Every project had the same illnesses: Copy-paste driven development, God classes, etc. Modern frameworks offers a lot of features to implement functionality super-fast, but when project grows almost all these "optimizations" becomes a big pain for developers. In the same time there a lot of dogmas, like SOLID and others, which described very abstractly and becomes some kind of cargo cults. "if project has 100% code coverage by unit tests, it has super code quality", "if project doesn't have static methods, it's well organized", etc. Someone very clever said: Software Engineering Is Art Of Compromise. Some of these dogmas have very important exceptions. Some of them easy to misunderstand.In this book I'm going to analyze usual project with common mistakes. How implementing new requirements can decrease code quality. Then step by step I'll show how I usually refactor the code: extracting classes, using DI, using exceptions. How this refactoring consequences moving to layered architecture. After moving to layered architecture we will talk about pro and contras of Command Query Responsibility Segregation(CQRS). After CQRS it's hard to don't talk about Event Sourcing(ES).I'll use examples in Laravel , but it's not very important. The book is about framework-agnostic code.
Author: Adel F