I prefer 2 and 4. I don't enjoy 3, because Plugin are thread-safe service and, like for widgets, I think it's a good and simple pratice to be stateless for a thread_safe service. Against Java, python allow to inject arbitrary arguments in the constructor, so avoid setter for initialisation phase (like done by some java IoC engine).

I add two propositions (because the meaning of this features is defined by TG, and every implementation use file to store templates):

6. Plugin expose via an attribute the extension of template files, and it's in charge of the caller of insert/render to resolv template path.

7. instead of set/copy configuration data into the template engine, initialisation sets/"injects" the function. ( function with 2 parameters : the template-location and the file extension for template file. In this case I prefer the **kw (2) for injecting the function.


--
--------------------------------------------------------------
David "Dwayne" Bernard            Freelance Developer

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to