
Java Reflection Guide From Basics to When Not to Use It
A complete guide to Java reflection: inspect and invoke classes, proxies, method handles, modules, performance, native image limits and when not to use it.
Layers, modules, boundaries and the decisions that are cheap now and expensive in two years.

A complete guide to Java reflection: inspect and invoke classes, proxies, method handles, modules, performance, native image limits and when not to use it.

A short list of clean code rules for Java that survive contact with real projects: naming, small methods, immutability, exceptions and when to ignore a rule.

Dependency injection means a class receives its collaborators instead of building them. See what that buys in tests and wiring, and what Spring adds.

A rule for choosing what to mock in Java tests: replace what you do not own or cannot run cheaply, and keep real the code whose behavior you are testing.

What the test pyramid says, why it fits business logic and fits badly for services that mostly connect a database to a queue, and what to draw instead.

Use Hibernate natural ids and business keys: map @NaturalId, look up by business key with caching, implement equals and hashCode safely and add constraints.

Compare Redis, Hazelcast and Infinispan for shared caching and state in Java: deployment model, data structures, near caches, consistency and when each fits.

Compare Caffeine, Guava Cache and Ehcache for in process caching in Java: eviction, refresh, statistics, Spring support and when you need a shared cache.

Implement multi tenancy with Hibernate: compare discriminator, schema and database per tenant, resolve the tenant per request and avoid cross tenant leaks.

Define a custom Java annotation with retention, target and parameters, read it with reflection, build a validator and see where processors fit.

See what generic type erasure removes at runtime, why new T and instanceof List of String fail, and the type token pattern that works around it.

Why native Java deserialization is dangerous, how gadget chains work, how to filter with ObjectInputFilter and what to use instead.
We send one email when a new post is published. No spam.