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

Поделиться
HTML-код
  • Опубликовано: 12 янв 2025

Комментарии • 34

  • @vtdx4
    @vtdx4 Месяц назад +1

    for me this is the most clear talk about DDD. concepts well explained, thank you

  • @mirageman2
    @mirageman2 2 года назад +34

    Great talk, thanks. Maybe you could do a part 2 where you show more code examples of multiple bounded contexts interacting with each other.

  • @stanleyy581
    @stanleyy581 3 месяца назад +1

    Came back from the domain driven design book by EE with lots of questions. This talk really elucidated some of the elusive concepts in DDD with real life examples. Great talk

  • @DomainDrivenDavid
    @DomainDrivenDavid Год назад +3

    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!

  • @surendardashinamurthy2154
    @surendardashinamurthy2154 2 года назад +2

    A clear and crispy talk. Much appreciated

  • @rodelias9378
    @rodelias9378 2 года назад +4

    Awesome talk!! Really well-explained and well-paced. Thx a lot!

  • @OscarAgreda
    @OscarAgreda 4 месяца назад

    Thank you . Your emphasis on concepts like Ubiquitous Language and Bounded Contexts is particularly valuable. One question I had: How might we balance the trade-offs between the flexibility of microservices and the structured approach of DDD in a rapidly evolving business environment?

  • @Personal-M.I.S.
    @Personal-M.I.S. 2 года назад +3

    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!

  • @bobslave7063
    @bobslave7063 Год назад +1

    Amazing lecture, thanks.

  • @Pest87
    @Pest87 Год назад +1

    This is a really great lecture

  • @LarrySmith1437
    @LarrySmith1437 2 года назад +4

    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 2 года назад +1

      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 2 года назад

      @@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 2 года назад +1

      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.

  • @chadlooker4657
    @chadlooker4657 Год назад

    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.

  • @stIncMale
    @stIncMale 2 года назад +12

    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 2 года назад +1

      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 2 года назад

      @@khajalieubarrie5088 That... is so meta. The ubiquitous language of programming itself.

    • @mihaiapostol7864
      @mihaiapostol7864 Год назад +2

      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

  • @thomas.moerman
    @thomas.moerman 2 года назад +19

    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 2 года назад +8

      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 2 года назад +3

      @@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.

  • @yapayzeka
    @yapayzeka 10 дней назад

    i think verrification depends on the usage of the value object so that usage context has to handle verrification as it needs. it is wrong to put that logic in value objects in my opinion.

  • @kiranbhanushali7069
    @kiranbhanushali7069 2 года назад +1

    Great Talk, Helpful.

  • @johnathanwaters5448
    @johnathanwaters5448 2 года назад +4

    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 2 года назад +3

      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.

  • @sandeeppandey1506
    @sandeeppandey1506 2 года назад +1

    Great Talk !!

  • @LittleLightCZ
    @LittleLightCZ Год назад +1

    👏👏👏

  • @gamingindustry6312
    @gamingindustry6312 2 года назад +1

    merci beaucoup a toi :))

  • @ВиталийПугач-к8ю
    @ВиталийПугач-к8ю 2 года назад +1

    Thanks

  • @wazum
    @wazum 2 года назад +5

    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 Год назад

    Hexagonal Architecture is dead and he doesn't know it. Hexagonal is a type of BCE, BCE is still king.