[erlang-questions] OTP application design

Kirill Zaborski qrilka@REDACTED
Tue Jun 12 21:56:41 CEST 2007

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.
Of course it would be better done with unit testing so the next task will be
getting used to EUnit.


On 6/12/07, Vlad Dumitrescu <vladdu55@REDACTED> wrote:
> On 6/12/07, Kirill Zaborski <qrilka@REDACTED> wrote:
> > Yes, I mean the same but th point is that there will be no "contract",
> and
> > logic implemented in both gen_servers should be checked manually (no
> common
> > interface except gen_server behavior) so if I create new function and
> new
> > handle_call clause in worker.erl I must remember to add the same clause
> in
> > emulator.erl
> > I know  it's just a habit of static typing :)
> > Thanks.
> Ah, now I finally get it! :-)
> If you do this in Java, with two classes implementing the same
> interface, then when adding a new method to the interface, you have to
> implement it in both classes, so what is the difference from the
> Erlang case?
> In Java you could have a common abstract class, but this only is
> useful if the two classes can share the implementation. If one does
> "real" work and the other just "emulates" it, then it is a high chance
> that for non-trivial cases the implementation can't be shared.
> regards,
> Vlad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20070612/044f9649/attachment.htm>

More information about the erlang-questions mailing list