Discussion: Use of template engine over custom solution
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start by reviewing the generator's existing template implementation and the ClassDescription model mentioned in the discussion. Compare the proposed FreeMarker, jtwig, and Thymeleaf approaches against the need for custom assertion logic; done means reaching an agreed direction and defining the migration scope.
Written by the indexing model from the issue text.
Description
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. 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 - 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 - Neat new engine I've not heard of, but looks incredibly nice. Similar feature set
- Thymeleaf - 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. :)
- Dominant language
- Java
- Stars
- 72
- Forks
- 47
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from assertj/assertj-generator
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
assertj/assertj-generator#278 ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
assertj/assertj-generator#220 ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
assertj/assertj-generator#219 ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
assertj/assertj-generator#204 · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
assertj/assertj-generator#197 · 7 comments ·
All issues in assertj/assertj-generator
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
area/frontend
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100