Skip to content

Types and Hierarchy of Martini Properties

In this section, we will explore the different types of properties used in Martini and their hierarchical structure. Understanding these types and their precedence is essential for effective configuration and management of your Martini applications.

Types of Properties

The types of properties in Martini define how configurations are handled and can affect application behavior in various environments.

  1. Package Properties: These properties define variables specific to the application, such as API keys and endpoint URLs. They can be customized for each environment.

  2. Application Properties: These properties govern the overall behavior of your Martini applications, including essential settings that affect application performance and functionality.

  3. System Properties: System properties are exposed by the operating system on which Martini is running. These settings can influence the runtime environment and overall stability.

  4. Environmental Variables: Environmental variables control application behavior based on the environment in which it is running. They are key to managing configurations that differ between development, testing, and production environments.

Hierarchy of Properties

The hierarchy of properties dictates the order in which different property files are processed, which affects which settings are applied.

  1. Package Environment Properties: Properties specific to a particular environment that override default package properties.

  2. Package Properties: The general properties defined for the application packages.

  3. Application Override Properties: These properties provide the ability to override default application settings for specific scenarios.

  4. Application Properties: The standard application properties that govern overall application behavior.

  5. System Properties: Properties that are exposed by the system on which Martini is running.

  6. Environmental Variables: Variables that manage configurations based on the runtime environment.

This hierarchy illustrates the sequence in which properties files are processed within Martini. Properties defined at higher levels take precedence over those at lower levels, meaning that those defined earlier in the sequence are executed first.

Understanding this hierarchy is essential for system administrators and developers