Are VALUE OBJECTS secretly overpowered?!

Поділитися
Вставка
  • Опубліковано 19 сер 2024
  • Morning gals and guys.
    In today's episode we'll talk about value objects and how they can be used.
    Twitter:
    / przylucki_p
    More me:
    saaslaravel.com
    Website:
    przemyslawprzy...
  • Наука та технологія

КОМЕНТАРІ • 38

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

    This is currently my daily favorite channel 🍀 Sooo much indepth about those stuffs

  • @free2idol1
    @free2idol1 Рік тому +2

    Awesome! I have used VO for a while but you've made it to the next level...
    I hope you can release a tutorial of making mini app using DDD architecture.

    • @saaslaravel
      @saaslaravel  Рік тому +5

      Thanks so much! Tutorial on my version DDD is on the immediate roadmap (and a secret project connected to it 😊)

    • @SemyonF89
      @SemyonF89 7 місяців тому

      Yep! we need it!

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

    It would be great to have generics in PHP so you could just pass a to your interface and use the Phone instead of a generic ValueObjectInterface for your isEqual definition

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

      That's what I tried to do with phpdoc off camera but couldn't get it to work unfortunately :c

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

      @@saaslaravel So sad... Hopefully, PHP will get native generics one day :D

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

      @@igorleal1798 there is a video by Brent where he explains why PHP can't have generics

    • @TheGajos
      @TheGajos 5 місяців тому

      @@mediliesActually we can have generics in PHP, just like Python does (comments)

    • @medilies
      @medilies 5 місяців тому

      @@TheGajos php annotations have no effect on runtime. they only improve IDE experience and work with static analyzers

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

    I have learned so much from your videos, thank you! This type of videos are just awesome!

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

    Great explanation!

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

    Great videos. Can you explain the difference between DTO & Value Object? Always confuse with this two terms.

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

      Thank you! In simple terms: Value object is a wrapper on a primitive inside of your system - phone, email, point, coupon etc, whereas DTO is an object with all of the data required for execution of a certain logic. DTOs often times include VO

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

      @@saaslaravel Thanks for the clarification! I probably already use DTO without knowing 😖

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

    I was puzzled by the interface. I thought you were going to extend a base value object class and put these common methods there?

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

    We miss you

    • @saaslaravel
      @saaslaravel  3 місяці тому +1

      I may or may not be getting back soon 👀

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

      @@saaslaravel all your your videos are inspiring! Just buil some CRM example with DB structure and it will be the,🚀

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

    Awesome 👌 can i have please the name of theme and the font😅 im addicted!

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

    Hey mate! One question if I may, how would you handle transliteration when it comes to slugs in Laravel?

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

      Hey! If you mean replacing characters like "ó" into "o" I think Str::slug handles that out of the box. If you mean localization - you could generate a slug that has a numeric ID and localized slug that's not taken into consideration in route binding i.e. "/blog/1-article"

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

      @@saaslaravel Yes, the first option, thank you very much! :D

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

    I think spatie laravel data package is better for this type of data transformation

    • @saaslaravel
      @saaslaravel  Рік тому +5

      It may be, but it's important to be able to understand what's happening under the hood or just being able to implement it from scratch! 😁

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

      @@saaslaravel I agree on this

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

    These look almost the same as the ones implemented in my package `laravel-value-objects` :)

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

      Hi there! I was not familiar with your package but it looks pretty cool - I didn't copy the implementation from there though if that's what you are inferring :)

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

      @@saaslaravel No, I'm just surprised at how close our thoughts are to each other on this topic. Even methods like "from". :))

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

      That's a common approach used in Laravel so that's probably why. I use that all of the time for DTOs as well

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

    Please I need a DDD tutorials