assertj / assertj/assertj-generator

Discussion: Use of template engine over custom solution

Abierto
#103 5 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Java
Estrellas
72
Forks
47
Merge medio
1 d 16 h
PR fusionados (30 d)
2

Descripción

This is not an issue, but a discussion as I've run into a bit of a road-block in my work.

Currently, the generator is configurable via changing the template values as shown [here](http://joel-costigliola.github.io/assertj/assertj-assertions-generator.html#generated-assertions-templates). The problem I'm having is that I want to add logic into these templates to, for example, generate a new assertion that is _only_ relevant to my classes. If I want to do this, I have to write my own parser logic and call the required templates -- rather than just loading new templates.

I think one of the simplest ways to allow more flexibility is to remove the template engine from the generator and focus on using an existing engine with predefined templates. I believe the primary value of the generator is generating the model of assertions (e.g. `ClassDescription`) and their associating naming conventions to allow for generating these assertions. We can use this model within another engine to generate assertions

* [Apache FreeMarker](http://freemarker.org) - tried and true, works easily and is well known. Many features available. Additionally, uses a similar syntax for the "base" templates that we have already (`${variable}`).
* [jtwig](http://jtwig.org) - Neat new engine I've not heard of, but looks incredibly nice. Similar feature set
* [Thymeleaf](http://www.thymeleaf.org/doc/tutorials/3.0/usingthymeleaf.html) - widely used, but I don't think it's well suited to work outside its domain of web generation

Looking for some input in this as I'm unsure if there were previously decisions made or after the fork it was just kept up as legacy. :)

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Empieza revisando la implementación existente de plantillas del generator y el modelo ClassDescription mencionado en la discusión. Compara los enfoques propuestos con FreeMarker, jtwig y Thymeleaf con respecto a la necesidad de lógica de aserciones personalizada; se considera terminado cuando se haya acordado una dirección y definido el alcance de la migración.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
java
Área
tooling
Tipo de issue
Nueva funcionalidad
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
25/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.