Objects as processes: Do you wrap message passing?

Vladimir Sekissov svg@REDACTED
Fri Apr 15 12:03:38 CEST 2005


Good day,
 
joelr1> Do you usually add an extra layer on top of this by wrapping dispatch
joelr1> functionality in a function? Is it better to add
joelr1> 
joelr1> bet_size(Limit, Foo, Bar, Stage) when pid(Limit) ->
joelr1>     Limit ! { self(), bet_size, Foo, Bar, Stage },
joelr1>     retrieve().
joelr1> 
joelr1> and then call 
joelr1> 
joelr1> fixed_limit:bet_size(Limit, ...)

It depends from how you prefer to think about your code in paticular
case.

If you think in terms of processes and protocols use messages and
describe protocol.

If you think in terms of modules/objects and interfaces wrap all in
functions and describe interface.

Best Regards,
Vladimir Sekissov



More information about the erlang-questions mailing list