The DI is used in the example currently, where the container is required to be injected for the Extension class. This can be improved to the version where the Twig will take care about it itself, by registering the Logic class as a runtime.
OxidEsales\...LogicInterface:
class: OxidEsales\...Logic
tags: [ 'twig.runtime' ]
OxidEsales\...Extension:
tags: [ 'twig.extension' ]
The DI is used in the example currently, where the container is required to be injected for the Extension class. This can be improved to the version where the Twig will take care about it itself, by registering the Logic class as a runtime.