What are declarative and programmatic approaches to configuring the cache?
Infinispan offers both declarative and programmatic configuration approaches.  Declarative configuration comes in a form of XML document that adheres to a provided Infinispan configuration XML schema. Every aspect of Infinispan that can be configured declaratively can also be configured programmatically. In fact, declarative configuration, behind the scenes, invokes programmatic configuration API as the XML configuration file is being processed. One can even use combination of these approaches. For example, you can read static XML configuration files and at runtime programmatically tune that same configuration. Or you can use a certain static configuration defined in XML as a starting point or template for defining additional configurations in runtime.