Friday, January 6, 2017

Property Augmentation

Property Augmentation is the process of adding new properties to an object without doing anything to existing properties.

Miranda uses this when it defines its properties and their default values.

Miranda looks at the command line for a properties file, but if it doesn't find one it looks in the system properties for a property named MirandaProperties.PROPERTY_SYSTEM_PROPERTIES (currently defined to be "com.ltsllc.miranda.Properties").  If that is not defined then the system uses the default name (currently "miranda.properties").

The system augments the system properties with default values (defined by MirandaProerties.DEFAULT_PROPERTIES) and then, if the properties file exists.  It tries to load that file and it uses that to augment the system properties.

One of the things about augmentation is that the last write wins, so this is really a long winded way of getting the system properties.

No comments:

Post a Comment