View Model vs Model in MVVM Design Pattern

Поделиться
HTML-код
  • Опубликовано: 17 ноя 2024

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

  • @judy8821
    @judy8821 4 года назад +1

    Thank you so much, Mohammad! This really helped me grasp the difference between VM and M.

    • @larryalan3078
      @larryalan3078 3 года назад

      I guess Im kinda off topic but does anybody know a good place to watch new tv shows online?

    • @andresking6220
      @andresking6220 3 года назад

      @Larry Alan Flixportal :P

    • @larryalan3078
      @larryalan3078 3 года назад

      @Andres King thank you, I went there and it seems like a nice service =) Appreciate it!!

    • @andresking6220
      @andresking6220 3 года назад

      @Larry Alan Glad I could help xD

  • @pijushdebbarma7979
    @pijushdebbarma7979 4 года назад

    Views (V) are not refectored from ContentView. However, Model and ViewMidel are clearly depicted here. But who are new to SwiftUI, they will face some confusion regarding MVVM architecture from this video. Please update full fledged MVVM app for us and keep it as much as small for simplicity. Thanks. Awesome

  • @StewartLynch
    @StewartLynch 4 года назад

    Another outstanding video. Well done. Lots of hidden nuggets in there too.

  • @WilfClegg
    @WilfClegg 4 года назад

    This is another great video on SwiftUI, Azam! You make it look so easy. My question is more model based. Why wouldn't you move ALL of the business rules into the View Model (i.e. the $100 and $500 minimums for checking and savings accounts) ? Is there a reason to assign business rules, directly in the domain model? Thanks!

    • @azamsharp
      @azamsharp  4 года назад +1

      The main purpose of VM is to simply data to the View. ViewModel can also validate rules like required fields or email patterns etc but the actual business rules belong either in RulesEngine or the Model itself. We don't want to expose Business Rules to the UI.

    • @RaviRanjan-xl7fk
      @RaviRanjan-xl7fk 2 года назад

      I am getting confused when I see some of the logic in the Model because all I Understand about my model is it is a piece of code that doesn't know anything even about his existence until someone gives him a value.

  • @yixe2253
    @yixe2253 4 года назад

    Hey Azam, how do I initate an ObservableObject inside another one and still have updates?
    Like for example inside the Global ObservableObject I have a property
    @Published var home = Home() // Home is also an ObservableObject

  • @didierburton
    @didierburton 4 года назад

    Great Tutorial. Re: business model rules, BankAccount should be able to live on its own, so should enum BankAccountType be rather defined with BankAccount instead of the ViewModel? Thx.

    • @azamsharp
      @azamsharp  4 года назад +1

      Yes you can create a separate fie for BankAccountType. I was just saving time to not add a separate file.

  • @himansupanigrahi9247
    @himansupanigrahi9247 4 года назад

    I found one of your nodejs course in udemy but I am a iOS developer. I am only aware of swift & I want to learn nodejs. So do I need to learn Java script before watching your nodejs course in udemy. Please tell me all the prerequisites before starting that course

    • @azamsharp
      @azamsharp  4 года назад

      There should be a free prereq video in the course, which you can watch. Yes JavaScript is prereq for the NodeJS course.

    • @himansupanigrahi9247
      @himansupanigrahi9247 4 года назад

      @@azamsharp thanks for the reply

  • @DimNovo
    @DimNovo 4 года назад +1

    Ok mr Azam, now i'm ready to open an account in your bank ... 🤑