mapstruct-patterns
MapStruct Patterns for Jakarta EE
Best practices for using MapStruct with constructor-based mapping to achieve compile-time safety. When constructors change, mappings fail to compile — no runtime surprises.
Core Philosophy
Use constructors, not setters. This gives you compile-time errors when fields change.
Records naturally enforce this. For mutable entities, use the @Default annotation.
CDI Setup
@Mapper(componentModel = "cdi") // CDI injection
public interface OrderMapper {
OrderResponse toResponse(Order order);
}
More from emvnuel/skill.md
lombok-patterns
Lombok annotations and best practices for Java 21+ projects. Use when reducing boilerplate, configuring builders, or choosing between Lombok and Records.
53quarkus-panache-smells
Detects and refactors ORM code smells in Quarkus Panache applications using the Repository pattern. Use when reviewing PanacheRepository code, diagnosing N+1 queries, data overfetching, or pagination issues.
39clean-code-principles
Detects violations of Clean Code principles and suggests refactorings. Use when reviewing code quality, improving readability, or refactoring methods, classes, and modules.
7rest-api-design
REST API design patterns and MicroProfile OpenAPI documentation. Use when designing endpoints, choosing HTTP methods, status codes, or documenting APIs with OpenAPI annotations.
5refactoring-catalog
Identifies code smells and applies refactoring techniques from Martin Fowler's catalog. Use when improving code structure, reducing complexity, or eliminating smells without changing behavior.
5gof-design-patterns
Detects opportunities to apply GoF Design Patterns in Jakarta EE/MicroProfile. Use when reviewing code for structural improvements or implementing creational, structural, or behavioral patterns.
5