[erlang-questions] Granularity of process (and module) identification. Was: Supervision strategies to automatically restart dynamically added children

Dhananjay Nene <>
Wed Mar 9 11:19:44 CET 2011

On Wed, Mar 9, 2011 at 4:26 AM, Lukas Larsson
<> wrote:
> You can still do a logical separation between a player and a game, it does not have to be physical. By creating an opaque datatype for each player which you only can access through the player module you put a separation in between the two concepts but still keep the same concurrent activities as there are in the world. i.e.
> -module(player).
> %% Private record
> -record(player, {name}).
> create() ->
>  #player{}.
> set_name(Name, Player) ->
>  Player#player{ name = Name }.
> get_name(Player) ->
>  Player#player.name.
> etc.
> This makes it (atleast for me) possible to enforce a logical model upon my physical restrictions which makes my code easier to read and also to maintain when upgrading.
> Lukas

Thanks. That clarifies and helps.


http://blog.dhananjaynene.com twitter: @dnene

More information about the erlang-questions mailing list