Hello, Lars! 2015-02-17 22:09 GMT+03:00 Lars Strojny <l...@strojny.net>:
> Looks cool and I could see a couple of interesting possibilities arising. > One thing: any particular reason ExtensionInterface is static? I could see > a couple of benefits having extensions carry state and registerExtension() > taking an instance of ExtensionInterface, not a class name. What do you > think? Thanks for the positive feedback! My first thought was to use instances for extensions: https://gist.github.com/lisachenko/ffcfdec4c46e01864b33. However, I have a doubts that this will introduce additional possibilities for side-effects, when extensions can be configured differently/loaded/unloaded. In this thread some people noticed this fact too and suggested to add a restrictions for preventing conditional parsing of the source code. So, static method and static registration was chosen to reduce a number of possible conditional extensions. This has some disadvantages (testing, configuration, etc), but should give better experience with parsing behavior.