The goal of this project is to generate Java code in the architecture used by Spring Boot projects, for generic domains, based on a class diagram of domains created in Astah.
- Git
- Astah
- AnyCode
First, install the Anycode plugin for Astah;
Create your class diagram following the desires of your heart (or your project);
Select the template path, and then the path where the generated code will be stored (usually ./result).
Click on 'Generate' and it's done :D
You can annotate your Astah classes with:
entityinterfacefinal- Any other Astah annotation (but we just create custom code for those two)
Our templates create automagically a lot of boilerplate code, based on those annotated classes:
- When annotating with
nothing at all- Common, boring domain classes. Boo.
- When using
interface- Common interfaces. A little less poopy.
- With
final- Incredible, non-extend-able-esque, Java
finalclasses. What were you expecting?
- Incredible, non-extend-able-esque, Java
- If you annotate your class with
entity, the magic happens:
As with any other internally used plugin, there are no intentions of making these Anycode templates fully abstract and reusable, there will always exist some limitations that we consider to be acceptable. That said, there are some requirements that need to be met so this project works just fine:
- All classes that you expect to be "rendered" need to be, and that's very important, inside a package of Astah;
- Associations must be named and have a cardinality defined.