Erlang hints for an OO junkie
Wed Aug 11 10:24:02 CEST 2004
You can always describe things as records, and when/if they become animate, then
that record can be used to spwn a process. And when it "dies", the state can be
stored as a record again in the database (or whatever).
I have a similar problem, about whether to use processes to implement windows.
Having to handle processes linked to each other in several overlapping
hierarchies is not fun at all, and I split the functionality in several smaller
parts, the simpler ones being just data in an ets table with one managing
process. This way I can have the top loop is significantly simpler. Maybe
something similar can be done for your application - for example have a "sound
manager" that just keeps track of where everyone is, and dispatches any sounds.
Just a thought: you could look at mdisp, an application written by ulf Wiger, to
be found among the user contributions on erlang.org. It could fit well in your
More information about the erlang-questions