How jtama/openrewrite-refactoring-as-code works
Main Components to Include:
Project Structure (Three Main Modules)
• toxic-library (Source)
• toxic-library-user (Target)
• toxic-library-remover (Transformation Rules)
OpenRewrite Integration Layer
• Recipe Components
• Transformation Rules
• META-INF/rewrite Configuration
┌─────────────────┐
• Toxic Library │ (Source Code to be Transformed)
• ┘
• ↓
┌─────────────────┐
• Transformation │ (OpenRewrite Recipes)
• Engine │
• ┘
• ↓
┌─────────────────┐
• Target Library │ (Transformed Code)
• ┘
Detailed Component Breakdown
a) Toxic Library (Source):
• FooBarUtils and BigDecimalUtils classes
b) Transformation Engine (toxic-library-remover):
• Central component with multiple internal modules
• RemoveFooBarUtilsIsEmpty
• RemoveFooBarUtilsStringFormatted
• RemoveLogStartInvocations
• UseObjectsCompare
• Configuration flow from rewrite.yml
c) Target Application (toxic-library-user):
• Transformed application structure
• Main components:
• Hostels
• Rockets
• Security
• Exceptions
Process Flow Indicators
• Validation/test feedback loops
Metadata Section
A small section showing:
• Project version
• OpenRewrite version
• Build tool information
Remember to include:
• Clear boundaries between modules
• Recipe discovery and application flow
• Test validation feedback loops
• Configuration management
• Build tool integration points
This will give other engineers a clear understanding of both the high-level architecture and the detailed transformation process.