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

Поділитися
Вставка
  • Опубліковано 22 лис 2024

КОМЕНТАРІ • 33

  • @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 Місяць тому

    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 2 місяці тому

    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?

  • @bobslave7063
    @bobslave7063 11 місяців тому +1

    Amazing lecture, thanks.

  • @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!

  • @Pest87
    @Pest87 Рік тому +1

    This is a really great lecture

  • @chadlooker4657
    @chadlooker4657 11 місяців тому

    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.

  • @kiranbhanushali7069
    @kiranbhanushali7069 Рік тому +1

    Great Talk, Helpful.

  • @sandeeppandey1506
    @sandeeppandey1506 Рік тому +1

    Great Talk !!

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

  • @LittleLightCZ
    @LittleLightCZ 10 місяців тому +1

    👏👏👏

  • @gamingindustry6312
    @gamingindustry6312 2 роки тому +1

    merci beaucoup a toi :))

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

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

    Thanks

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

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

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

  • @nichtverstehen2045
    @nichtverstehen2045 3 місяці тому

    meaningless stream of buzzwords

  • @luisdanielmesa
    @luisdanielmesa Рік тому

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