Reflection: Inspecting a program's own structure at runtime — listing a class's methods, or checking a value's type dynamically. Reflection is a program's ability to inspect its own structure while running: list a class's methods and properties, read their types and attributes, or check what a function expects as arguments. Frameworks rely on it heavily. Laravel's service container uses reflection to see which dependencies a constructor needs and injects them automatically. Routing, validation and serialisation libraries read attributes and types the same way.
In your own application code, reflection is rarely the right tool. It is slower than direct calls, bypasses the normal visibility rules and makes code harder for editors and static analysis to follow. It is excellent for building frameworks, test tools and generic utilities, and best kept out of everyday business logic.
Implement proven backend architecture patterns including Clean Architecture, Hexagonal Architecture, and Domain-Driven Design. Use this skill when designing clean architecture for a new microservice, when refactoring a monolith to use bounded contexts, when implementing hexagonal or onion architecture patterns, or when debugging dependency cycles between application layers.