<!DOCTYPE html><html><head><title></title><style type="text/css">#qt p.qt-MsoNormal{margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:0in;font-size:11pt;font-family:"Calibri", sans-serif;}
#qt a:link{color:blue;text-decoration-line:underline;text-decoration-style:solid;text-decoration-color:currentcolor;text-decoration-thickness:auto;}
p.MsoNormal,p.MsoNoSpacing{margin:0}
p.MsoNormal,p.MsoNoSpacing{margin:0}</style></head><body><div>I'll drop in this effort that was made years ago: <a href="https://github.com/erlware/erlware_commons/blob/master/doc/signatures.md">https://github.com/erlware/erlware_commons/blob/master/doc/signatures.md</a><br></div><div><br></div><div>But I'm not saying I recommend it, I don't know that it is used much and I'd like to deprecate erlware_commons in the not too distant future (it is a dependency used by rebar3/relx and we want to remove as many of those as possible).<br></div><div><br></div><div>I'll also point out my use of behaviours to provide APIs for functionality (an Application Programming INTERFACE -- so "interface" isn't always an OOP construct). Hah, just realized I even called it an "interface" in my most recent PR <a href="https://github.com/open-telemetry/opentelemetry-erlang/pull/269">https://github.com/open-telemetry/opentelemetry-erlang/pull/269</a><br></div><div><br></div><div>On Tue, Aug 24, 2021, at 15:46, Brett Hemes wrote:<br></div><blockquote type="cite" id="qt" style="overflow-wrap:break-word;"><div class="qt-WordSection1"><p class="qt-MsoNormal">> Erlang's behaviour is NOT an interface!<br></p><p class="qt-MsoNormal">> If you are looking for some analogy from other languages the closest one is abstract classes in C#.<br></p><p class="qt-MsoNormal"> <br></p><p class="qt-MsoNormal">This isn’t very helpful... it is the exact same response I find in the forums with no reasoning behind it. I don’t need analogies either; I understand what behaviours are “supposed” to be from the documentation and comments (perhaps this
wasn’t made clear by my post). Where I fall short is “why” are behaviours limited to such and why aren’t more people asking the same questions I am stuck on (regarding polymorphism)? My logic was: yes, this has been asked and discussed some in the past with
no real resolution that I could find... therefore, users must be content/accepting of the tools provided. I am not so naive to think I am the first to need/want such, so there must be a disconnect.<br></p><p class="qt-MsoNormal"> <br></p><p class="qt-MsoNormal">I posted my example to motivate my questioning hoping for some insight and/or comfort. As of now, I have proceeded with storing “meta refs” to my child servers that are module/reference tuples (along with some dangerous and future-maintenance-issue-causing
assumptions regarding their “interface”)... and it’s works... it just smells, and I am always eager to learn and find the right/better/best way.<br></p><p class="qt-MsoNormal"> <br></p><p class="qt-MsoNormal">Aside: a colleague came across this repo (<a href="https://github.com/eldarko/epolymorph">https://github.com/eldarko/epolymorph</a>) while digging and the readme seems to capture my use case almost exactly...<br></p><p class="qt-MsoNormal"> <br></p><p class="qt-MsoNormal">Brett<br></p></div></blockquote><div><br></div></body></html>