erlang polymorphism: multiple implementations of the same contract -
please advice: what's correct erlang way have separated implementations contract , how switch between them?
thanks hints! yf
while others mention behaviour feature, merely small helper make sure implement functions in module callback structure. if have 2 implementations, a , b, , both implements same functions, can statically substitute a b in calling module. static configuration have better implementation, preferable.
if question of more dynamic nature, can do
mod = a, mod:f(args). and in code set mod appropriately. lets dynamically control module call while program running. not entirely clear of 2 want.
Comments
Post a Comment