MVVM to the rescue

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

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

  • @ProgramArtist
    @ProgramArtist  7 лет назад +1

    Let me know what would you like me to talk about, it can be anything as long as it is programming related

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

    no body on the whole internet explained this concept so good like u bro thanks a lot

  • @gilmualem7253
    @gilmualem7253 7 лет назад

    אתה מדהים

  • @lisasievers5261
    @lisasievers5261 6 лет назад

    Can you do a vid on using a laravel 'base' app with microservices as spa's?

  • @bekzod3322
    @bekzod3322 7 лет назад

    Have I understood correctly, in View-Model there should be no model at all?

    • @ProgramArtist
      @ProgramArtist  7 лет назад

      Bek Zod not exactly. The view model is the model of the view. If you strip all the buttons and the text boxes and leave only the meaning of them you'll be left with the view model. It can expose a whole object of the model and the view bounds to some properties of the model. So the view can contain model objects but shouldn't contain any business logic. Hope I was clear

    • @bekzod3322
      @bekzod3322 7 лет назад

      @ProgramArtist Well I get it, what I meant was that, for example in my applications React + React Native, I consider services as objects which get me information/data from external sources (database, some data from device and etc.). Models and ViewModels are pure javscript code which is environment agnostic and testable code, which is by the way plays well with inversify and in order to achieve MVVM I use mobx. But here in your video you are using services to instruct models to do smth. As if services are acting like a gateway. And with this approach yes view can be anything electron, web and mobile. So what I wanted to clarify and know your opinion. Do I have to use services to get models, well because in this case services will have two roles.

    • @ProgramArtist
      @ProgramArtist  7 лет назад

      Bek Zod if you think about the model as a combination between the state of your app and the data from external sources you will see that you use it the same way. The services fetch/update the external sources data and they update the state of the app by returning the new updated models. If you for example think of redux, the reducers are those services and the app state is the model. Think of a flow in your app when a user presses some button and it fetches new data from the servers, its probably doing what I described. Also in a case where the user updates the data like making some changes and pressing submit or save.