Entity vs Model in Flutter Clean Architecture

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

КОМЕНТАРІ • 8

  • @jhonrhayparreno7220
    @jhonrhayparreno7220 2 місяці тому

    I have a question when rendering in the UI layer do you used entities or models? or when setting up in the bloc state?

    • @Chaplin_law
      @Chaplin_law 2 місяці тому

      I think it makes more sense to use entities when it comes to the presentation layer

    • @thesunstep
      @thesunstep 2 місяці тому +1

      He explained this in the video, the server gives data, which the model converts into an object. Then you pass that model and map it to an entity. Then in the presentation layer you use the entity.

  • @Anilkumar-ec8sj
    @Anilkumar-ec8sj 2 місяці тому

    I would suggest to make notes or presentation lot of things said skips in mind better to go point by point .. great and useful video , thanks

  • @ji_ukor
    @ji_ukor 2 місяці тому +1

    I don't call my model, I call it Entities and DTOs

  • @saroj6062
    @saroj6062 2 місяці тому

    If i use freezed for modeling, how do i manage model , entity. And where should be that freezed model ? domain or data layer. My question is, how can we use freezed in clean architecture?

    • @ChorumTheDevourer
      @ChorumTheDevourer 2 місяці тому

      Freezed class and toEntity method/fromEntity factory must be placed in data layer in model only. Entity - this is a simple and clean class without any logic. Freezed is very useful for model generation, this package can save you from a boilerplated code, but build runner is very slow on the big projects. If you using any other generators like retrofit generator, hive generator or riverpod generator, building/watching in the project with a many of freezed model becomes painful.

  • @aouadicharaf1038
    @aouadicharaf1038 2 місяці тому

    ❤❤❤