Max (7) [Avatar] Offline
#1
Question to book's author, Debasish.

Thanks for succinct and informative book, I'm half the way and enjoing it very much.

  • Could you give your extended comment on Eric Evan's strong dislike of "anemic models"?

  • Is this a single DDD principle which we completely discard in the context of functional programming?

  • FP seems to stress bare data structures as building blocks (ADT). Can Evan's position be explained by his OOP roots? Does the principle of "non-anemic domain models" be useful in any FP context? Any example of its usefulness in FP, especially if language permits OO style?

  • Debasish Ghosh (116) [Avatar] Offline
    #2
    > Could you give your extended comment on Eric Evan's strong dislike of "anemic models"?

    I am not sure if Eric Evans strongly dislikes anemic models. But when DDD came into existence mostly with Eric's book, all mainstream OO languages espoused domain models which tend to have state and behavior of objects within the same abstraction. This was the "class" in class based OO languages. Designers used to think that keeping state and behavior together also makes the model cohesive - I get *all* details of my abstraction within the same unit. Eric's DDD book also followed the same principle. I am not saying it's incorrect - in fact there are lots of successful instances of mainstream OO based DDD implementations running today. In the book I have just taken an orthogonal view based on my experience over the last 5 years or so. It's just an alternative view which I think is worth exploring.

    > Is this a single DDD principle which we completely discard in the context of functional programming?

    Not sure which principle are you talking about. I don't think DDD ever mentions anything about class based or function based implementation of the solution architecture. The only guideline it gives is to put enough emphasis on the domain model as it appears in the problem domain.

    > FP seems to stress bare data structures as building blocks (ADT). Can Evan's position be explained by his OOP roots? Does the principle of "non-anemic domain models" be useful in any FP context? Any example of its usefulness in FP, especially if language permits OO style?

    In FP the most important principle is compositionality. Functions compose in the mathematical sense of the term, objects don't. Evans has adopted an implementation strategy based on OO and I am sure he has many successful instances of DDD running today. I have just taken an orthogonal view. As they say "all models are incorrect, some are useful" smilie
    Max (7) [Avatar] Offline
    #3
    > ...Functions compose in the mathematical sense of the term, objects don't...
    Thanks for this important phrase, Debasish.


    For reference:
    Martin Fowler on anemic model illustrating DDD: http://www.martinfowler.com/bliki/AnemicDomainModel.html
    524864 (5) [Avatar] Offline
    #4
    play game
    Hello guys Have the most fun to join the our site online it is the most popular free online fun zone you have the full entertainment to connect this link gggg it provides you the best game forever so thanks for the visit the online i sure you like fun zone very much one of the best online gaming for the players.