43 ms·
I don't think you have a grasp on what DDD is or confusing it with more concrete architectural or design patterns. An ORM has nothing to do with Domain-Driven D
by tomnipotent 5y ago
I don't think you have a grasp on what DDD is or confusing it with more concrete architectural or design patterns. An ORM has nothing to do with Domain-Driven Design, nor bounded contexts or aggregate roots or events or the many other parts that are DDD.
- hardwaresofton 5y agoAgain, I really think we're having some fundamental disagreements about what "DDD" is. Maybe that term is just doomed and what I'll say from now on is "hexagonal infrastructure". For now, this is where I'm drawing my definition (that I use in this thread) of what DDD is, and what makes me think ORMs are indeed DDD: https://en.wikipedia.org/wiki/Domain-driven_design#Building_blocks https://en.wikipedia.org/wiki/Domain-driven_design#Building_...
- dragonwriter 5y ago> For now, this is where I'm drawing my definition (that I use in this thread) of what DDD is, and what makes me think ORMs are indeed DDD That doesn’t mention ORMs at all, and I’m not sure what in that source gave you the idea. ORM had no fundamental connection to DDD; an ORM could be used in the implementation of Repositories, but there is no strong link between the ideas.
- camgunz 5y agoI said this up a little further but, I think there's realistically no way to avoid an ORM when implementing DDD in an OO language, using an SQL database. Like, like it or not, DDD's wheelhouse was going into Java shops and telling them how to structure their apps. Those shops use objects and they almost certainly (though not absolutely certainly) use a relational database. You're not gonna get away from mapping your relational data to your objects, the only choice you have is to use an off the shelf ORM, or to build your own. So I think that's mostly inarguable. I do think building an app on a document database is interesting though, because then there's no need for the "mapping", so to speak (depending on how static/dynamic your OO language is), but I don't necessarily see how that fact means that ORMs aren't DDD. But broadly, the case I'm referring to is: - We wanted to implement DDD - We were using Django, i.e. QuerySets and Models - We wrapped QuerySets to make "repositories" - We wrapped Models to make "entities" - This was silly (read: more confusing, slower, and a waste of engineering resources), because QuerySets and Models are already DDD, because ORMs are DDD
- tomnipotent 5y agoIf your only reference is Wikipedia, it's going to be hard to have a productive conversation. The fact that these two things share words, doesn't make them related other than the fact the same English words are used. If I were to see an ORM-tied object in the business logic of a DDD-based application, something has gone horribly, horribly wrong.
- hardwaresofton 5y agoIt's not the only reference, but I bring it out because you and I are talking past each other, and shared definitions or discovering differences between our definitions and what others think is the only way past an impasse like that. Thanks for the attempt at discussion, but looks like there's no more productive discussion to be had.
- tomnipotent 5y agoWe're not talking past each other, rather you seem to lack a fundamental understanding of DDD but feel confident to speak matter-of-factly about it. There's as much a relationship between DDD and ORMs as there is between Agile and ORMs or queues and ORMs.
- hardwaresofton 5y agoWell so far all you've done is suggest that Wikipedia is wrong (or using it as as a source is wrong?) and you're right, so I hope you'll excuse me for not putting any stock in your opinion. If you do happen to find time to put your thoughts down to paper with some sources anywhere in the public sphere I'd love to read about it! :)