[erlang-questions] Configuration management below the application layer?

Joern <>
Tue Aug 14 18:00:57 CEST 2007


Dear list,

I am aware of the application-wide configuration mechanisms provided
by the OTP. Now I am interested in the configuration of individual,
named (registered) processes. My initial idea was like this:

  - Provide a gen_server which maintains the configuration data. It's
API would allow the re-reading of configuration options, provides
named processes with the configuration data relevant to them and
applies defaults where not overridden (via proplists)

  - All configurable modules must maintain an arbitrary { state, ... }
record which has an arbitrary { config, ... } record in it.

  - All configurable modules must accept a system message {
configuration_changed, { config, ... } }. Depending wheater the
configuration change requires a restart of that component or not {
stop, configuration_changed ... } or { no_reply, ... } is returned.

Now to my problem: behaviours functions are class-functions, so I have
no sensible way (except cascading behaviours for gen_*) of getting an
appropriate handle_info(...) into the configurable module. Is there
some way to add "instance" inheritance to behaviours? Yariv Sadans
smerl seems to "extend" on function name and arity instead of
patterns.

Or is there some obvious way to handle configuration management for
processes I am not aware of?

Thanks again,


Joern
--



More information about the erlang-questions mailing list