6 deleted 397 characters in body
source | link

In his book 'Clean Architecture', Uncle Bob says that the Presenter should put the data that it receives into something he calls the 'View Model'.

enter image description here

Is this the same thing as the 'ViewModel' from the Model-View-ViewModel (MVVM) design pattern or is it a simple Data Transfer Object (DTO)?

If it is not a simple DTO, how does it relate to the View? Does the view get updates from it through an Observer relationship?

My guess is that it is more like the ViewModel from MVVM, because in Chapter 23 of his book, Robert Martin says:

[The Presenter's] job is to accept data from the application and format it for presentation so that the View can simply move it to the screen. For example, if the application wants a date displayed in a field, it will hand the Presenter a Date object. The Presenter will then format that data into an appropriate string and place it in a simple data structure called the View model, where the View can find it.

This implies that the View is somehow connected to the ViewModel, as opposed to simply recieving it as a function argument for example (as would be the case with a DTO).

Another reason why I think this is because if you look at the image, the Presenter uses the View Model, but not the View. Whereas the Presenter uses both the Output Boundary and the Output Data DTO.

If it is neither a DTO nor the ViewModel from MVVM, please elaborate as to what it is.

Thanks in advance.

Edit: For anybody reading this article: Even though there are already some answers, if you have a different opinion about the solution to my question, then feel free to create your own answer. I don't mind having extra points of view (no pun intended).

Also, make sure that you read every answer, because so far, the answers that I've received vary significantly.

In his book 'Clean Architecture', Uncle Bob says that the Presenter should put the data that it receives into something he calls the 'View Model'.

enter image description here

Is this the same thing as the 'ViewModel' from the Model-View-ViewModel (MVVM) design pattern or is it a simple Data Transfer Object (DTO)?

If it is not a simple DTO, how does it relate to the View? Does the view get updates from it through an Observer relationship?

My guess is that it is more like the ViewModel from MVVM, because in Chapter 23 of his book, Robert Martin says:

[The Presenter's] job is to accept data from the application and format it for presentation so that the View can simply move it to the screen. For example, if the application wants a date displayed in a field, it will hand the Presenter a Date object. The Presenter will then format that data into an appropriate string and place it in a simple data structure called the View model, where the View can find it.

This implies that the View is somehow connected to the ViewModel, as opposed to simply recieving it as a function argument for example (as would be the case with a DTO).

Another reason why I think this is because if you look at the image, the Presenter uses the View Model, but not the View. Whereas the Presenter uses both the Output Boundary and the Output Data DTO.

If it is neither a DTO nor the ViewModel from MVVM, please elaborate as to what it is.

Thanks in advance.

Edit: For anybody reading this article: Even though there are already some answers, if you have a different opinion about the solution to my question, then feel free to create your own answer. I don't mind having extra points of view (no pun intended).

Also, make sure that you read every answer, because so far, the answers that I've received vary significantly.

In his book 'Clean Architecture', Uncle Bob says that the Presenter should put the data that it receives into something he calls the 'View Model'.

enter image description here

Is this the same thing as the 'ViewModel' from the Model-View-ViewModel (MVVM) design pattern or is it a simple Data Transfer Object (DTO)?

If it is not a simple DTO, how does it relate to the View? Does the view get updates from it through an Observer relationship?

My guess is that it is more like the ViewModel from MVVM, because in Chapter 23 of his book, Robert Martin says:

[The Presenter's] job is to accept data from the application and format it for presentation so that the View can simply move it to the screen. For example, if the application wants a date displayed in a field, it will hand the Presenter a Date object. The Presenter will then format that data into an appropriate string and place it in a simple data structure called the View model, where the View can find it.

This implies that the View is somehow connected to the ViewModel, as opposed to simply recieving it as a function argument for example (as would be the case with a DTO).

Another reason why I think this is because if you look at the image, the Presenter uses the View Model, but not the View. Whereas the Presenter uses both the Output Boundary and the Output Data DTO.

If it is neither a DTO nor the ViewModel from MVVM, please elaborate as to what it is.

    Tweeted twitter.com/StackSoftEng/status/1053345043929620481
5 added 377 characters in body
source | link

In his book 'Clean Architecture', Uncle Bob says that the Presenter should put the data that it receives into something he calls the 'View Model'.

enter image description here

Is this the same thing as the 'ViewModel' from the Model-View-ViewModel (MVVM) design pattern or is it a simple Data Transfer Object (DTO)?

If it is not a simple DTO, how does it relate to the View? Does the view get updates from it through an Observer relationship?

My guess is that it is more like the ViewModel from MVVM, because in Chapter 23 of his book, Robert Martin says:

[The Presenter's] job is to accept data from the application and format it for presentation so that the View can simply move it to the screen. For example, if the application wants a date displayed in a field, it will hand the Presenter a Date object. The Presenter will then format that data into an appropriate string and place it in a simple data structure called the View model, where the View can find it.

This implies that the View is somehow connected to the ViewModel, as opposed to simply recieving it as a function argument for example (as would be the case with a DTO).

Another reason why I think this is because if you look at the image, the Presenter uses the View Model, but not the View. Whereas the Presenter uses both the Output Boundary and the Output Data DTO.

If it is neither a DTO nor the ViewModel from MVVM, please elaborate as to what it is.

Thanks in advance.

Edit: For anybody reading this article: Even though there are already some answers, if you have a different opinion about the solution to my question, then feel free to create your own answer. I don't mind having extra points of view (no pun intended).

Also, make sure that you read every answer, because so far, the answers that I've received vary significantly.

In his book 'Clean Architecture', Uncle Bob says that the Presenter should put the data that it receives into something he calls the 'View Model'.

enter image description here

Is this the same thing as the 'ViewModel' from the Model-View-ViewModel (MVVM) design pattern or is it a simple Data Transfer Object (DTO)?

If it is not a simple DTO, how does it relate to the View? Does the view get updates from it through an Observer relationship?

My guess is that it is more like the ViewModel from MVVM, because in Chapter 23 of his book, Robert Martin says:

[The Presenter's] job is to accept data from the application and format it for presentation so that the View can simply move it to the screen. For example, if the application wants a date displayed in a field, it will hand the Presenter a Date object. The Presenter will then format that data into an appropriate string and place it in a simple data structure called the View model, where the View can find it.

This implies that the View is somehow connected to the ViewModel, as opposed to simply recieving it as a function argument for example (as would be the case with a DTO).

Another reason why I think this is because if you look at the image, the Presenter uses the View Model, but not the View. Whereas the Presenter uses both the Output Boundary and the Output Data DTO.

If it is neither a DTO nor the ViewModel from MVVM, please elaborate as to what it is.

Thanks in advance.

In his book 'Clean Architecture', Uncle Bob says that the Presenter should put the data that it receives into something he calls the 'View Model'.

enter image description here

Is this the same thing as the 'ViewModel' from the Model-View-ViewModel (MVVM) design pattern or is it a simple Data Transfer Object (DTO)?

If it is not a simple DTO, how does it relate to the View? Does the view get updates from it through an Observer relationship?

My guess is that it is more like the ViewModel from MVVM, because in Chapter 23 of his book, Robert Martin says:

[The Presenter's] job is to accept data from the application and format it for presentation so that the View can simply move it to the screen. For example, if the application wants a date displayed in a field, it will hand the Presenter a Date object. The Presenter will then format that data into an appropriate string and place it in a simple data structure called the View model, where the View can find it.

This implies that the View is somehow connected to the ViewModel, as opposed to simply recieving it as a function argument for example (as would be the case with a DTO).

Another reason why I think this is because if you look at the image, the Presenter uses the View Model, but not the View. Whereas the Presenter uses both the Output Boundary and the Output Data DTO.

If it is neither a DTO nor the ViewModel from MVVM, please elaborate as to what it is.

Thanks in advance.

Edit: For anybody reading this article: Even though there are already some answers, if you have a different opinion about the solution to my question, then feel free to create your own answer. I don't mind having extra points of view (no pun intended).

Also, make sure that you read every answer, because so far, the answers that I've received vary significantly.

4 Improve tags
| link
3 Improve tags
| link
2 Improve tags
| link
1
source | link