Detailed technical breakdowns of architectural patterns and design decisions.
How room prices are calculated step by step
Prices flow through stages: base calculation, then modifiers like taxes and discounts. Each stage is independent, so new pricing rules can be added without changing existing code. The result includes a full breakdown of how the price was calculated.
Core principles that guide my architectural decisions.
Dependencies point inward. Domain layer has no knowledge of outer layers. Business logic is framework-agnostic.
Single responsibility, open-closed, Liskov substitution, interface segregation, and dependency inversion.
Bounded contexts, aggregates, value objects, and ubiquitous language to model complex business domains.
PHPStan level 9, strict types, readonly classes, and typed properties to catch bugs at compile time.
Prefer immutable value objects and DTOs. Mutations return new instances rather than modifying state.
Dependency injection, interface-based design, and pure functions make code easy to unit test.