[erlang-questions] OTP application design
Vlad Dumitrescu
vladdu55@REDACTED
Tue Jun 12 21:43:56 CEST 2007
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
More information about the erlang-questions
mailing list