how to design large erlang systems

Corrado Santoro <>
Tue Apr 19 19:49:37 CEST 2005


Martin Ankerl wrote:
> Hi! A few days ago I have started to look at Erlang, and so far I
> really like it. Having mostly OOP background, I am very curious how
> large software systems are designed in Erlang. I mean, I can design
> large object oriented systems with class hierarchies, namespaces,
> packages etc; while in erlang each file is one module (in case I did
> not miss something).
> Are there any documents for design patterns or best-practices for how
> to write large Erlang applications?
My two cents... I think that development techniques, in Erlang, differ 
substantially from those of other OO languages such as C++ or Java.

First of all, in C++ or Java, you must encode everything you need inside 
a class (and this concept is more stresses in Java). This forces you to 
have many files, even if they are not really needed. In the same way, 
when you have to solve a problem using a design pattern, you need many 
classes.

In Erlang instead you focus on functionalities, rather than on the 
structure of your class/objects/etc. So, in this case, you will encode 
your pattern inside a single module exporting the proper functions to 
use those functionalities. This prevents namespace pollution.

Indeed, writing "good" programs in Erlang coming from an OO language is 
not trivial (for my experience), because one tends to use the same 
idioms of Java or C++. IMHO, this is not a good approach: looking at the 
way in which library modules are structured and encoded, as well as the 
possibility offered by OTP and behaviours, is instead fruitfull.

> I would also be very interested in some kind of "Erlang for Java
> /C#/Ruby/Python developers" document :-)
I suggest instead the PhD thesis of Joe Armstrong, which explains the 
basics of software engineering with Erlang, i.e. the concurrency-based 
approach. However I forgot the URL of this document, could anyone 
provide it?

Ciao,
--Corrado

-- 
======================================================
Eng. Corrado Santoro, Ph.D.

University of Catania - Engineering Faculty
Department of Computer Science and
Telecommunications Engineering
Viale A. Doria, 6 - 95125 CATANIA (ITALY)

Tel: +39 095 7382144 Int. (5) 8035
      +39 095 7382380
      +39 095 7382365
      +39 095 7382364

VoIP: sip:

Fax: +39 095 7382397

EMail: 
Personal Home Page:
             http://www.diit.unict.it/users/csanto

NUXI Home Page:
             http://nuxi.iit.unict.it
======================================================




More information about the erlang-questions mailing list