question
Ulf Wiger
ulf.wiger@REDACTED
Mon Dec 15 22:38:47 CET 2003
These patterns are to a large extent tied to OO.
You need to understand the patterns -- or more to the
point, understand why you need them. Then, based on your
understanding of Erlang (or any other non-OO language)
figure out how you can accomplish the task without them,
while still getting the job done elegantly. (:
Or simply forget about those patterns and approach Erlang
with an open mind. Then, you may revisit those patterns after
having written some programs in Erlang, and you will find that
you solved those problems more elegantly without thinking about
it much.
Perhaps not the answer you were hoping for, but you really
shouldn't do object-oriented programming by the book in Erlang.
An OO language would be much better for that.
Some of the behaviours you will find basically implemented already.
For example, gen_event seems awfully similar to the reactor pattern.
I found descriptions of some of the patterns you mention at
http://www.cs.wustl.edu/~schmidt/patterns-ace.html
I didn't try to go through your entire list, but:
The 'active object' pattern is a good example of how something that
Erlang programmers do almost on a daily basis can become horribly
complex in a programming environment that wasn't designed with
concurrency in mind. Compare with regular Erlang processes and e.g.
the gen_server behaviour, and you will find much more powerful, but
also much more intuitive constructs than the 'active object' design
pattern.
/Uffe
On Mon, 15 Dec 2003 12:05:21 -0800 (PST), mohammad banat
<banat82@REDACTED> wrote:
> hello,
>
> please i just want to ask
>
> can i implement these patterns reactor,router,active
> object,half-sync/half-async,connector,acceptor,service configuration)
> using erlang????????????
>
>
> ---------------------------------
> Do you Yahoo!?
> New Yahoo! Photos - easier uploading and sharing
--
Ulf Wiger
More information about the erlang-questions
mailing list