I’ve always understood DRY to be about not duplicating concepts rather than not duplicating code.
In the example here, you have separate concepts that happen to use very similar code right now. It’s not repeating yourself as the concepts are not the same. The real key is understanding that, which to be fair, is mentioned in the article.
IMO, this is where techniques like Domain-Driven Design really shine as they put the business concepts at the forefront of things.
As already mentioned, the blue book by Evic Evans is a good reference, but it’s a ittle dry. Vaughn Vernon has a book, “Implementing Domain-Driven Design” that is a little easier to get into.
Personally, I found that I only really grokked it when I worked on a project that used event-sourcing a few years back. When you don’t have the crutch of just doing CRUD with a relational database, you’re forced to think about business workflows - and that’s really the key to properly understanding Domain-Driven Design.
Yeah for me the understanding really came when working in a federated GraphQL API. Each team had us own little slice of overall object graph, and overlap / duplication / confusing objects across the whole domain were a lot easier to see in that environment.
“Domain Driven Design” by Eric Evans, aka the blue book. It’s very dense however and very object oriented, but concepts apply even if you dont work with object oriented languages, you might have to do more footwork to get from a domain model to services that adhere to the model.
“Head first Software Architecture” might be an easier on ramp and touches on simmiliar concepts.
That’s how DRY is described in Pragmatic Programmer, where DRY was first coined. They’re clear that just because code look similar, doesn’t necessarily mean it’s the same.
yes, this is exactly what you have to think about. the left example even aknowledges that deadlines for “tasks” might be different from deadlines for “payments”, which suggests that the abstraction is not “clean”.
I’ve always understood DRY to be about not duplicating concepts rather than not duplicating code.
In the example here, you have separate concepts that happen to use very similar code right now. It’s not repeating yourself as the concepts are not the same. The real key is understanding that, which to be fair, is mentioned in the article.
IMO, this is where techniques like Domain-Driven Design really shine as they put the business concepts at the forefront of things.
Do you have a resource on where to learn DDD? I feel like I never understood the concept well.
If you can work with python cosmic python (http://www.cosmicpython.com/book/preface.html) is a great resource
As already mentioned, the blue book by Evic Evans is a good reference, but it’s a ittle dry. Vaughn Vernon has a book, “Implementing Domain-Driven Design” that is a little easier to get into.
Personally, I found that I only really grokked it when I worked on a project that used event-sourcing a few years back. When you don’t have the crutch of just doing CRUD with a relational database, you’re forced to think about business workflows - and that’s really the key to properly understanding Domain-Driven Design.
Yeah for me the understanding really came when working in a federated GraphQL API. Each team had us own little slice of overall object graph, and overlap / duplication / confusing objects across the whole domain were a lot easier to see in that environment.
“Domain Driven Design” by Eric Evans, aka the blue book. It’s very dense however and very object oriented, but concepts apply even if you dont work with object oriented languages, you might have to do more footwork to get from a domain model to services that adhere to the model.
“Head first Software Architecture” might be an easier on ramp and touches on simmiliar concepts.
That’s how DRY is described in Pragmatic Programmer, where DRY was first coined. They’re clear that just because code look similar, doesn’t necessarily mean it’s the same.
yes, this is exactly what you have to think about. the left example even aknowledges that deadlines for “tasks” might be different from deadlines for “payments”, which suggests that the abstraction is not “clean”.
It should be about concepts but it’s more often applied to duplicate algorithms by inexperienced people (which is a huge mistake).
I guess I never thought of it like this, but it resonates.