Тёмный

Writing cleaner code with Domain Driven Design by Paul van der Slot 

Devoxx
Подписаться 156 тыс.
Просмотров 40 тыс.
50% 1

I always thought that my code was fine. I took my time for naming things, wrote small classes/methods and tried to use other Clean Code practices. But after a job interview with a technical coach, I was pointed towards Domain-Driven Design (DDD) and some other design topics. I could learn a lot from it, said the technical coach. And I did! Since then, I started noticing how much parts of DDD could help with my day to day job. I will take you with me on my learning journey of Domain-Driven Design, and how it helped me improve my code. We will touch upon themes like Ubiquitous Language, Supple Design, Bounded Contexts and more. You can expect a talk with a lot of code examples and practical advise that you can use the next day.

Наука

Опубликовано:

 

12 окт 2022

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 31   
@mirageman2
@mirageman2 Год назад
Great talk, thanks. Maybe you could do a part 2 where you show more code examples of multiple bounded contexts interacting with each other.
@surendardashinamurthy2154
@surendardashinamurthy2154 Год назад
A clear and crispy talk. Much appreciated
@rodelias9378
@rodelias9378 Год назад
Awesome talk!! Really well-explained and well-paced. Thx a lot!
@DomainDrivenDavid
@DomainDrivenDavid 10 месяцев назад
Very good, thank you! I am in the staring phase of understanding DDD and clean architecture, and I am implementing this on the next professional application I am working on!
@Personal-M.I.S.
@Personal-M.I.S. Год назад
This is good stuff! I've been trying to wrap my head around DDD for a while and some of this has really clicked. Skoal!
@Pest87
@Pest87 Год назад
This is a really great lecture
@bobslave7063
@bobslave7063 7 месяцев назад
Amazing lecture, thanks.
@kiranbhanushali7069
@kiranbhanushali7069 Год назад
Great Talk, Helpful.
@sandeeppandey1506
@sandeeppandey1506 Год назад
Great Talk !!
@gamingindustry6312
@gamingindustry6312 Год назад
merci beaucoup a toi :))
@user-sg4kw8uh3m
@user-sg4kw8uh3m Год назад
Thanks
@chadlooker4657
@chadlooker4657 7 месяцев назад
An "anemic domain-model" sounds more intuitive given that we write data-processing programs. The data outside the program is inert, e.g. the JSON you get over the wire or your row in the database doesn't have behavior. It makes more sense to me to model the data as data, and place what you do with the data somewhere else.
@LarrySmith1437
@LarrySmith1437 Год назад
I'm interested in the following: once you decided that Employee is represented almost independently inside various bounded contexts, how can you later find out about an "Employee" ACROSS the bounded contexts? I get that they're different representations in each context but it still feels like in some situations there could be an implicit relationship of an entity across the contexts.
@paulvfc
@paulvfc Год назад
Good question. I would say an employee originates from one context. Maybe the HR context where a candidate becomes an employee after signing a contract. After that an event could be fired like 'Employee hired'. Other contexts could listen to that and use the same Employee id(as a reference) to create a consultant for instance in the sales context. If you want to have an overview of everything related to that employee you could group information of different bounded contexts, using the shared employee id.
@LarrySmith1437
@LarrySmith1437 Год назад
@@paulvfc I like that answer it makes sense there would be one authoritative demand that others could key off of and I also like the thought about using Events the other domains can listen to if they want to do something about their version of employee
@sebastianpopa4778
@sebastianpopa4778 Год назад
my 2 cents. An "employee" does not really exist "across" bounded contexts. If it does, is mostly by mistake or by some misfortunate language representation. So in the example with "employee" and "consultant", it becomes obvious that there has to be some aggregation of "pieces" ("employee", "consultant") which lives outside of these bounded contexts and (forcefully) puts the pieces together. Often these are just "reports", and since they are rather technical than business, not sure makes much sense to think of them as "bounded contexts" (maybe as support business context). As some others commented, there should be another talk (Paul? ;) ) reg. communication and translations (or not) between bounded contexts.
@LittleLightCZ
@LittleLightCZ 6 месяцев назад
👏👏👏
@thomas.moerman
@thomas.moerman Год назад
I would recommend against the use of derogatory of terms like "Primitive obsession" like it's some kind of accepted truth that using primitives is bad practice. It's not. For instance, there are a ton of cons to the "Wrapper obsession" remedy you propose: code bloat, superfluous indirection, the "private language" problem that DDD using OO typically suffers from.... There are always trade-offs.
@paulvfc
@paulvfc Год назад
Indeed Thomas, there are always tradeoffs. I would recommend agains using wrappers for everything. Some Strings that need validation and have some business logic are perfect cases in my opinion. Think about an IBAN (validated), and which you might ask the country code (substring). But wrapping a firstName in another object is not something I do. No validation needed, no extra logic, just code bloat.
@thomas.moerman
@thomas.moerman Год назад
@@paulvfc I understand your point. Given a typical OO language like Java it is a reasonable approach. Other languages offer different possibilities for the example you describe. For instance what I typically do: leave the email-address as a string, but instrument functions (at the contextual boundaries or where-ever you like) with spec validation that can be turned on/off using a flag, depending on the deployment env. This approach doesn't seem like a big improvement at first sight but *dramatically* simplifies nested data-structures that pass through domain functions. Plus the significant advantage that I can use whatever functions my language offers to manipulate Lists, Maps, Vectors, Strings and other primitive scalars to manipulate the data structures while they pass through my domain functions, leading to much less code. The shape and type of these structures are spec'ed in the appropriate time and place, enabling a leaner approach and more opportunities for generic function design because there are no "private domain language" classes to take into account. Check out Rich Hickey's talks for a more elaborate perspective on this matter.
@johnathanwaters5448
@johnathanwaters5448 Год назад
I may be misunderstanding, but is this basically a way to use ideas from functional programming in object oriented implementations, via the use of typing?
@khajalieubarrie5088
@khajalieubarrie5088 Год назад
Domain Driven Design is agnostic to a programming paradigm. It’s more of a design approach I believe. To take your problems and solution from the Enterprise world to software world. However, Object Oriented Design aligns with arguably all of its construct.
@stIncMale
@stIncMale Год назад
22:19 "tell, don't ask" - it's irritating when people keep coming with weird names for ideas that already have a name (I understand that this name was not invented by the speaker). This one, for example, is called "encapsulation".
@khajalieubarrie5088
@khajalieubarrie5088 Год назад
I think there’s a deliberate reason cause if someone think they already know encapsulation and you tell them to always favour it in domain driven design, it can mean different thing to different people.
@LarrySmith1437
@LarrySmith1437 Год назад
@@khajalieubarrie5088 That... is so meta. The ubiquitous language of programming itself.
@mihaiapostol7864
@mihaiapostol7864 9 месяцев назад
for me this phrasing represents "intentional" encapsulation. usually when you're taught about encapsulation you're only taught about getters and setters. the concept of "tell don't ask" goes further
@wazum
@wazum Год назад
Hm, there are multiple things wrong in this talk, e.g. Validation and Transformation in the (MongoDB) repository? Definitely not the right place for that.
@BuriTechVids
@BuriTechVids Год назад
It depends how you perceive those terms. For example when you're using Doctrine/Hibernate library in infrastructure on the side of repositories, there's always some validation and transformation into domain objects. Or for example we are checking tenant id in multi-tenant application for each received object even it's already handled by database itself. Just to be sure/to double-check that we're not receiving what we shouldn't receive.
@Emerald214
@Emerald214 Год назад
Agreed. The repository has a dependency on DTOs such as Card, which is weird. Secondly, sometimes the validation depends on other entities. A single repository can't validation and transformation alone.
@luisdanielmesa
@luisdanielmesa 10 месяцев назад
Hexagonal Architecture is dead and he doesn't know it. Hexagonal is a type of BCE, BCE is still king.
@purpinkn
@purpinkn Год назад
Wtf is he talking about
Далее
меня не было еще год
08:33
Просмотров 1,5 млн
The Art of Discovering Bounded Contexts by Nick Tune
41:53
Domain Driven Design: The Good Parts - Jimmy Bogard
58:39
🚀  TDD, Where Did It All Go Wrong (Ian Cooper)
1:03:55
Просмотров 552 тыс.
Designing and Implementing Aggregates - Mariusz Gil
1:21:41
Игровой Комп с Авито за 4500р
1:00