-
Notifications
You must be signed in to change notification settings - Fork 0
Home
José Carlos Canova edited this page May 4, 2025
·
11 revisions
- Provide java class generation over database schema based on bytebuddy component. The class model will reside over JPA as well other database communication technologies like Spring Data JDBC (which at principle shows to be simpler than JPA). The model is an introductory design to speed up model definition that can be time consuming depending on the complexity of the database model.
- Provide java source code over the database class model adopting a simple approach based on reverse engineer the class model using a component like vineflower, in principle the POJO model is perfect suitable for code generation since it`s code is merely based on field declaration, their accessors and mutators (remembering that class generation dont use lombok component) and support methods like hashcode,equals,compare,toString. So the reverse engineering from the class generated model fits well on the scenario proposed and avoid a roundtrip on usage of template(java code generation by predefined code with token substitution strategy) strategies. Bytebuddy offer a fluent programming model which at my perspective is simple to maintain that template strategy, for example JPA and Validation API have a significant amount of annotations and mix together "String templates with token substitution" can lead to unnecessary code complexity.
- The initial purpose were generate just the compiled class file but, initial tests with reverse engineering of the bytecode file shown that is feasible provide also the java file so,the plugin will offer in the configuration the alternative to generate the source file too or, just the source file.
- Simplify maven plugin coding, avoiding string templates which are in my perspective harder to maintain and manage.
- Another advantage to adopt ByteBuddy is the detailed annotation definition that permits to test the ORM implementation on it's adherence on specification (J2EE specification).
- Versioning of standards on bytecode generation. JPA belongs to J2EE standard and in future API versioning must be adopted for backward/forward compatibility.
- Sophistication of code, code is beyond the simple, since bytebuddy is not a trivial library, the component has a large object model and, the learning curve (of bytebuddy) takes some time.
- The time dedicated for the development in future will be reduced (i really hope so) for now its a full time dedication but my expectation is that other projects appear (lucrative projects), current project is a research experiment that could lead to a product development if sponsored.