Domain Modeling Made Functional - Scott Wlaschin

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 ก.ย. 2024
  • 🗓️ Upcoming developer events: dev.events Statically typed functional programming languages encourage a very different way of thinking about types. The type system is your friend, not an annoyance, and can be used in many ways that might not be familiar to OO programmers. Types can be used to represent the domain in a fine-grained, self documenting way. And in many cases, types can even be used to encode business rules so that you literally cannot create incorrect code. You can then use the static type checking almost as an instant unit test - making sure that your code is correct at compile time. In this talk, we'll look at some of the ways you can use types as part of a domain driven design process, with some simple real world examples in F#. No jargon, no maths, and no prior F# experience necessary.

ความคิดเห็น • 9

  • @alerya100
    @alerya100 7 หลายเดือนก่อน +1

    Scott Wlaschin is a god tier teacher !

  • @PaulSebastianM
    @PaulSebastianM 3 หลายเดือนก่อน +4

    I think it's ironical that OO was invented to properly model domains and the real world and has been the main approach for doing that for decades, yet FP has been doing a better job of this for equally the same amount of time, but almost nobody uses it.

  • @SeanJung-rx1vo
    @SeanJung-rx1vo 4 หลายเดือนก่อน +1

    I applied a valid type by referring to the video. The code has become more readable. thank you

  • @bentosalvador336
    @bentosalvador336 17 วันที่ผ่านมา

    man, I am from OO world, but I found very awesome insights in this talk. Thank you so much. I have a honest question, about using wrappers to model concepts and using that instead of primitive types and enforce domain rules. Can I say that this is the same as ValueObjects from the OO world? Or maybe the Layer Super Type pattern (Fowler)? It seems very similar to me. If any one from functional worlds can answer that, I would appreciate.

  • @alexandreg3933
    @alexandreg3933 4 หลายเดือนก่อน

    Excellent and insightful talk

  • @user-rl3cu9eo3m
    @user-rl3cu9eo3m หลายเดือนก่อน

    He's assuming that the only way to get a VerifiedEmail should be through a VerificationService that does the actual verification, because the domain expert said so.
    But most of the time, you are going to need to get a VerifiedEmail instance just because the database says so, or the JSON you got from a web service says so.
    If you have secured your code to specifically deny access to any other way of getting a verified email (to prevent "errors")... what are you gonna do?

  • @clamato422
    @clamato422 หลายเดือนก่อน

    As a fellow gray hair, he gives me hope for a new career in programming.

  • @ryanhewitt9902
    @ryanhewitt9902 7 หลายเดือนก่อน

    There are not enough comments here - this was a well put together presentation! My question is: Can I use this technique in a Lisp-like language? I like the idea of thinking with algebraic types in order to get a birds' eye view, and wonder if I can apply this sort of thinking to languages lacking algebraic union types and compilers.

    • @lukaszkalnik
      @lukaszkalnik 2 หลายเดือนก่อน

      In pure Lisp not really, but there seem to be libraries for this, e.g. cl-algebraic-data-type