Think you accidentally only sent this to me, so I’ll bring it back here. So how about this: I don’t update the existing code-gen module to the new SPI3, but instead bring a new one based on JavaPoet and we leave the old one here. If we decide it’s too hard to maintain the new one, we can revive the old one and update it to the changes? The changes needed to update the current templates should not be challenging at all.
Chris Von: Łukasz Dywicki <[email protected]> Datum: Donnerstag, 1. Januar 2026 um 19:22 An: Christofer Dutz <[email protected]> Betreff: Re: Update Code-Gen for SPI3 changes? Using a code to generate code, avoiding templates will be helpful. I recall good old times of JAXB with its codemodel and writing generator plugins with it wasn't a bad experience. Maybe, just maybe, based on observations it will be possible to do similar for other languages? Anyhow, as far I recall code generator is plugable at plc4x maven plugin, so its about a time to use this extensibility. :-) Best, Łukasz On 12/28/25 20:33, Christofer Dutz wrote: > Hi all, > > As I am finished with the new Buffers, in order to use them I need to update > the code-generation to reflect the changes. > Currently all code-generators use the same method of using FreeMarker > templates to generate the code. > > Initially I was planning on simply updating these templates to the new buffer > api. > > For ToddySoft however I built a completely new code-gen that uses JavaPoet. > > It has the advantage of being a lot more readable code, as there is no > mixture of template and logic. > With java-poet it’s for example simple to iterate over all fields of a type > and in that iteration output the properties, constructor arguments, getters, > serializer, parser, getLengthInBits etc. > However I regularly got lost in where I need to change something to have code > output changed in a desired way. > Another disadvantage is, that JavaPoet is only available for Java … so all > other languages are left out. > > Admittedly I would prefer to stick with FreeMarker and possibly cleanup the > templated and helpers. > > What do you folks think? > > Chris > >
