Show HN: JavaFactory – IntelliJ plugin to generate Java code
a year ago
- #Java
- #Code Generation
- #Automation
- JavaFactory is a tool that uses LLMs to generate repetitive Java code with predictable and stable results.
- It operates based on two core components: Pattern Definition and Annotation-Based Reference Collection.
- Patterns can be reused to generate various types of code like implementations, tests, and fixtures.
- Installation is done via IntelliJ's plugin marketplace.
- Patterns consist of Goal, Rules, Output, and Example sections, which can be customized.
- Annotations like @JavaFactoryData and @JavaFactoryApi help in explicitly scoping classes for code generation.
- JavaFactory is ideal for environments with repeating patterns like layered architecture.
- Tasks like dao-repository-implementation, domain-api-test, etc., can be automated after defining the rule once.
- Recommended to manually design critical components (red boxes) and automate others (blue boxes) with JavaFactory.