The difference is that with Java interfaces compiler checks that I have implemented all the needed functions and with dynamic typing in Erlang I must do it manually.<br>Of course it would be better done with unit testing so the next task will be getting used to EUnit.
<br><br>Regards,<br>Kirill.<br><br><div><span class="gmail_quote">On 6/12/07, <b class="gmail_sendername">Vlad Dumitrescu</b> <<a href="mailto:vladdu55@gmail.com">vladdu55@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On 6/12/07, Kirill Zaborski <<a href="mailto:qrilka@gmail.com">qrilka@gmail.com</a>> wrote:<br>> Yes, I mean the same but th point is that there will be no "contract", and<br>> logic implemented in both gen_servers should be checked manually (no common
<br>> interface except gen_server behavior) so if I create new function and new<br>> handle_call clause in worker.erl I must remember to add the same clause in<br>> emulator.erl<br>> I know it's just a habit of static typing :)
<br>> Thanks.<br><br>Ah, now I finally get it! :-)<br><br>If you do this in Java, with two classes implementing the same<br>interface, then when adding a new method to the interface, you have to<br>implement it in both classes, so what is the difference from the
<br>Erlang case?<br><br>In Java you could have a common abstract class, but this only is<br>useful if the two classes can share the implementation. If one does<br>"real" work and the other just "emulates" it, then it is a high chance
<br>that for non-trivial cases the implementation can't be shared.<br><br>regards,<br>Vlad<br></blockquote></div><br>