How to „register“ a new Describer

Adding Describer Classes should be easy, as I suggest that to be the most agile part in Lalm development for a long time. Generating descriptions is different between languages and there are a lot of strategies to implement the generator, starting from string substitutions up to highly complex Natural Language Generation engines with highly sophisticated grammar assemblers, sentence planning stuff and so on.

Unfortunately Tapestry is developed following a strong mantra: Static Structure, Dynamic Behavior.

In fact that means that a Tapestry template is static, even a component’s template is static and cannot change substantially. It’s possible to hardcode alternatives and use a parameter or some other data source to choose one of them, but every alternative again has to be hardcoded in that template and (!) in the corresponding components java class.

Therefore adding a new describer component involves the following steps:

  1. implement the describer component’s class.
  2. add it to the ConfigurableDescriberComponent.java source:
    1. put it into the describerMap hashmap by extending the initDescriberMap() method.
    2. inject the block like it’s done with the other blocks
  3. add the new block to the ConfigurableDescriberComponent.tml

Using the Describer afterwards simply involves setting the configuration value in the lalm.properties file.

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.

Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.