Introduction

smartics-properties is a library for Java to declare and define properties and to access them from an application in a convenient way.

Convenience?

Convenience means that properties are easily

  1. declared (as an annotated Java interface)
  2. defined (e.g. in form of properties files on the classpath)
  3. resolved (e.g. construct properties with place holders like ${server.url}/index.html)
  4. converted (e.g. to an URL or custom instance)
  5. validated (e.g. mandatory values or a value within a given range)
  6. accessed (typesafe)
  7. stored (e.g. file system or database)
  8. documented (e.g. to display error information to the user or generate reports)
  9. managed (e.g. via a small web application)

The library may be installed as an extension to a JBoss AS 7.

To access life values from the application, use the web application smartics-properties-admin-rest.

More visual ...

Properties are declared as annotated interfaces in form of methods. The definition of a property is a key-value pair. The value may contain placeholder that references another property by its key. On accessing a property value by its name, the original string value is resolved, converted to its target type and validated. Properties are stored in a data store (e.g. a database), the are documented in form of reports and they are managed by a REST web application.

In more Words ...

Properties are used to configure an application. This is what the well-known Properties class of the Java SDK is all about: Simple key/value tuples of type String. It is quite easy to load properties files from a stream or from the class path. But a standardized way to provide property values is not defined. In other words: The developer has to define a location to place the properties file and write the couple of lines of code to access it. Once in memory, the developer has to manage the properties and make it accessible by all clients.

This would be more convenient: the developer declares the properties at one place and the deployer provides the property values at another. And without further ado the system makes the property values available for an application through a simple API. The properties are manages by a simple web application and documented by reports for the release. This is what smartics-properties can do for you.

Note that smartics' properties come in three multi-tenant flavors:

  • configuration properties
  • feature toggles
  • user preferences

Where to go for more Information?

Please check out our 5 minutes tutorial to get an overview over this library. This will get you started with the concepts of declaring, defining and accessing properties.

If you are interested in storing properties, please jump to Supported Stores.

If you want to get more information on the reporting feature, please check out the smartics-properties plugin for Maven.

Finally, if you want to get some screen shots of the web application for managing properties, please refer to the Admin REST project.