assertj / assertj/assertj-generator
Discussion: Use of template engine over custom solution
- Lingua principale
- Java
- Stelle
- 72
- Fork
- 47
- Merge medio
- 1g 16h
- PR unite (30g)
- 2
Descrizione
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. :)
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia esaminando l’implementazione esistente dei template del generator e il modello ClassDescription menzionato nella discussione. Confronta gli approcci proposti con FreeMarker, jtwig e Thymeleaf rispetto alla necessità di una logica di asserzione personalizzata; il lavoro è completato quando si è raggiunta una direzione condivisa e si è definito l’ambito della migrazione.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- java
- Ambito
- tooling
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 25/100