views:

162

answers:

2

It may sound like a stupid idea but I was just wondering if there is an equivalent of DDD in FP? It seems to me that DDD is only valid in OOP paradigm. Thanks.

A: 

Domain Specific Languages. See for example this book.

Jared Updike
+5  A: 

It depends how seriously you preach the DDD gospel:

  • If you buy into all the details of Erik Evans's book, especially the stuff in Part II that is heavily object-oriented, than no sane person would try to duplicate that in a functional language.

  • If your interest is primarily in Part I of the book, that everyone on the project should have in common a language in the domain, then the leaders in the functional-programming movement have been in the area of embedded domain-specific languages. These are common currency now, but a paper by Erik Meijer and Daan Leijen at DSL'99 did a great deal to make these techniques popular. Constructing an embedded DSL is now a very popular technique in functional programming, and if you search for embedded domain specific Haskell you will find many examples.

So my answer is: the important, foundational ideas of Domain-Driven Design can be applied in a functional setting, but many of the object-oriented details are irrelevant.

Norman Ramsey