Typescript Design Patterns: Repository design pattern

Поделиться
HTML-код
  • Опубликовано: 25 окт 2024
  • In this video, I will walk you through the Repository Design Pattern in Typescript. You will learn about separating your Data logic and your ServiceClass logic. If this kind of content is useful to you, please support me by giving me a like and subscribe to my channel!
    And as always, Thanks for watching!
    #typescript #designPatterns #repositoryDesignPattern

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

  • @OmarRodriguez-gu5nh
    @OmarRodriguez-gu5nh Год назад +23

    Service should consume the repo, not the other way out

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

    I can't believe how clearly you can explain these concepts. Excellent video, thank you!

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

      thanks, i haven't made any videos in quite some time but am considering continuing

  • @hocinebenzagouta8829
    @hocinebenzagouta8829 Год назад +4

    Wouldn't it be the other way ? Repository should get data from api since it's a data source, then it's the job of the service to process and map the data and passes it to the service?

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

    Curious about why the repo should depend on service layer?

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

    Great explaination, thanks!

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

    One question Jaime, in the StudentRepository class you pass in the constructor the interface iStudentServices, and then in line 33, you're using the getStudent method from StudentServices class, but I can't see where are you passing a new instance of that class to the Repository. Hope you can help me to clarify that! Anyway, great video, thanks for sharing!

  • @ТёмаКоролёв-к6ф
    @ТёмаКоролёв-к6ф 2 года назад +5

    Ты путаешь принцип паттерна. Репозиторий не может вызывать сервис. Сервис делает валидацю входящих данных и передает их в репозиторий, а репозиторий тем временем уже обращается к хранилищу данных (API, DATABASE).

  • @pramishluitel
    @pramishluitel 6 месяцев назад

    I think it should be other way around
    Service -> Repository
    Not Repository -> Service.
    Thanks for your video anyway :)

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

    Hello this is wrong! Service is consuming Repo!

  • @AlanDanielx
    @AlanDanielx 11 месяцев назад

    Need real use examples ..

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

    Muito bom! Nota zero