Tag Archives: code

Custom mint2 behaviour

Fotis and I have different ideas on how to realize the customization of functionality in mint2. Here are the 2 approaches.

  • New functionality is coded into the base version of Mint. It is surrounded by checks for a configuration variable that only exists in customized versions that wants this functionality. If two custom versions share the same customized functionality, they simply use the same configuration variable.
  • New functionality is coded into special class CustomBehaviour which inherits from class custom. On places where you want custom functionality, you make static calls to the Custom class, which reroutes them to the CustomBehaviour class. If you want to share functionality, you have to code it into the base code and call from CustomBehaviour into it.
  • Both approaches work and should not differ too much in performance. Having coded the latter, I believe that the config approach is good, but suffers from config file bloat and difficult maintenance. So it should be used sparingly, and where the configuration is actually a string value and not a selector for different functionality. The disadvantage is, that you need to edit code and not config if you want to change behaviour.

    For the time being, I will use my approach for customizing Solrize behaviour, until I get convinced of the config file approach.