Announcement Announcement Module
No announcement yet.
Spring service configuration pattern Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring service configuration pattern

    I need to store a few configuration parameters somewhere for my Spring services. Those parameters can be changed by service admins only and they must be stored somewhere between two executions of my web application. Examples of such parameters can be email server address to send notifications to service members, administrator email address and so on.

    Typically, in a desktop application, such configuration data is stored in a configuration file, possibly in XML, it's loaded on each application startup and updated when the application stops. So this is one solution I could chose : storing parameters in an XML file and load it when the Spring service is initialized.

    On the other hand, contrary to the vast majority of desktop applications, in my environment I have a Hibernate-accessible database under my Spring layer, and this is meant for storage. So I could also define a Hibernate entity to store all the service configuration stuff, but then that entity would be somehow original since there should be only one in the database.

    And maybe there are solutions I don't even think of. So my question is simple : are there common design patterns to store Spring service configuration data ?

  • #2
    Take a look at this post for wiring configuration data from a database.