Posted by on July 07, 2009
Finally off school and with a lot of free time in the summer to devote to side projects. To warm myself back into writing blog posts I decided to start with a fairly simple but very useful topic: application configuration.
I’ve seen a few small Erlang projects resort to custom configuration syntax, strange XML parsing, etc. for configuration but Erlang has support for easy application configuration built right in! The syntax is simple enough for a non-programmer to grok and is extremely flexible for application developers. As an added bonus, no external libraries are required.
Posted by on September 15, 2008
This is the fifth article in the otp introduction series. If you haven’t yet, I recommend you start with the first article which talks about gen_server and lays the foundation for our bank system. If you’re a quick learner, you can read the completed erlang files so far: eb_atm.erl, eb_event_manager.erl, eb_server.erl, eb_sup.erl, and eb_withdrawal_handler.erl.
The Scenario: The ErlyBank system is in a nice state right now with everything wrapped up under the supervisor, but ErlyBank is pressuring us to come up with a package which specifies an overall version so the system can be upgraded as a whole and can be controlled easily. They’ve commissioned us to do this task.
The Result: Erlang/OTP has a built-in module for making a set of modules which achieve some set of functionality into an application. An application can be started and stopped as a unit and can easily be reused in other systems.