Behaviours

Mickael Remond mickael.remond@REDACTED
Sun Sep 8 20:52:50 CEST 2002


Alex Peake <apeake@REDACTED>: 
 
> Thank you Francesco. 
>  
> I guess the answer is that there is nothing "of a tutorial nature". 
>  
> I was looking for more of: 
>  
> What is a behaviour? When do you need one? How do you build one? 
>  
> (I saw a quote from Joe Armstrong something of the nature that -- in Erlang 
> you do not need objects 
> because you have behaviours -- so I wanted to explore what this meant) 
 
Regarding behaviours, most of the time you need to _use_ an existing behaviour 
(found in the Erlang/OTP framework): You write a module that implements 
specific code and use generic code of a behaviour. You should very rarely need 
to write your own behaviour, like you asked in your previous question. 
 
Joe Armstrong phrase does not mean that behaviours are used like object (The 
first things you need to do in an object system is to create a new one), but 
that the behaviour mechanism is a powerful way to solve some of the problems 
that object was made for (Most notably provide an architecture model for your 
application). 
 
--  
Mickaël Rémond 



More information about the erlang-questions mailing list