Click here to Skip to main content
15,877,553 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
QuestionIs a separate view model relevant for Blazor server side given that we can test the whole component with bUnit? Pin
Mr Yossu25-Feb-24 5:38
Mr Yossu25-Feb-24 5:38 
AnswerRe: Is a separate view model relevant for Blazor server side given that we can test the whole component with bUnit? Pin
Gerry Schmitz25-Feb-24 10:06
mveGerry Schmitz25-Feb-24 10:06 
GeneralRe: Is a separate view model relevant for Blazor server side given that we can test the whole component with bUnit? Pin
Mr Yossu26-Feb-24 3:37
Mr Yossu26-Feb-24 3:37 
Thanks for the reply, but I'm not sure I agree with you on quite a few points.

View models (in the general sense of any MV* patterns) first came to the public attention in 1979 with Smalltalk, whereas the first visual designers for software development weren't until at least a decade later. Visual Basic was probably the first real visual designer, but didn't came out until 1991. Even if you want to stretch the point and include things like Hypercard, you only get a few more years (1987), still well after view models.

My understanding is that the point of view models was to separate the data access, logic and models from the UI. Yes, this was partly to allow the two to be developed independently, and possibly by different teams, but also (and possibly more importantly) to allow the former to be unit tested, something that was impossible in the early days of UI, and is still not so easy.

However, I don't really see the relevance. The idea of separating code into separate units is still useful, and binding is merely the common agreement between them. It doesn't really imply any bleeding going on. The view model can expose properties to be bound, and it's up to the view to choose whether or not to bind to them. That's not such a strong dependency.

Finally, even assuming your estimate of the average age of an app to be correct (which I would dispute, as I still maintain several projects that have been active for 10, 15 and in one case 25 years), why is that relevant? Length of life is not generally a determining factor in how you structure your projects, and separating layers is not just for multiple platforms.

Don't mean to be rude, but I really don't see how any of your points address my question. Please feel free to clarify if I've missed something.
GeneralRe: Is a separate view model relevant for Blazor server side given that we can test the whole component with bUnit? Pin
Gerry Schmitz26-Feb-24 4:43
mveGerry Schmitz26-Feb-24 4:43 
GeneralRe: Is a separate view model relevant for Blazor server side given that we can test the whole component with bUnit? Pin
Mr Yossu26-Feb-24 4:49
Mr Yossu26-Feb-24 4:49 
AnswerRe: Is a separate view model relevant for Blazor server side given that we can test the whole component with bUnit? Pin
jschell26-Feb-24 12:32
jschell26-Feb-24 12:32 
AnswerRe: Oh my goodness! Pin
Dave Kreskowiak24-Feb-24 4:38
mveDave Kreskowiak24-Feb-24 4:38 
GeneralRe: Oh my goodness! Pin
Gerry Schmitz24-Feb-24 4:42
mveGerry Schmitz24-Feb-24 4:42 
GeneralRe: Oh my goodness! Pin
Dave Kreskowiak24-Feb-24 5:53
mveDave Kreskowiak24-Feb-24 5:53 
QuestionC# How to populate datagridview from a separate combobox selection Pin
mourad barsoum22-Feb-24 12:57
mourad barsoum22-Feb-24 12:57 
AnswerRe: C# How to populate datagridview from a separate combobox selection Pin
Gerry Schmitz23-Feb-24 7:40
mveGerry Schmitz23-Feb-24 7:40 
AnswerRe: C# How to populate datagridview from a separate combobox selection Pin
Vrend Top11-Apr-24 1:13
Vrend Top11-Apr-24 1:13 
GeneralRe: C# How to populate datagridview from a separate combobox selection Pin
RedDk11-Apr-24 8:11
RedDk11-Apr-24 8:11 
QuestionTop 100 algorithm Pin
mike741120-Jan-24 10:39
mike741120-Jan-24 10:39 
AnswerRe: Top 100 algorithm Pin
Richard MacCutchan29-Jan-24 4:21
mveRichard MacCutchan29-Jan-24 4:21 
AnswerRe: Top 100 algorithm Pin
Pete O'Hanlon29-Jan-24 4:34
mvePete O'Hanlon29-Jan-24 4:34 
Questionuser data system for a web-based e-mail service Pin
mike741115-Jan-24 2:04
mike741115-Jan-24 2:04 
AnswerRe: user data system for a web-based e-mail service Pin
Richard MacCutchan15-Jan-24 2:25
mveRichard MacCutchan15-Jan-24 2:25 
AnswerRe: user data system for a web-based e-mail service Pin
jschell15-Jan-24 4:12
jschell15-Jan-24 4:12 
AnswerRe: user data system for a web-based e-mail service Pin
Eddy Vluggen16-Jan-24 5:00
professionalEddy Vluggen16-Jan-24 5:00 
GeneralRe: user data system for a web-based e-mail service Pin
jschell17-Jan-24 4:24
jschell17-Jan-24 4:24 
GeneralRe: user data system for a web-based e-mail service Pin
Richard MacCutchan17-Jan-24 5:33
mveRichard MacCutchan17-Jan-24 5:33 
GeneralRe: user data system for a web-based e-mail service Pin
RedDk17-Jan-24 8:24
RedDk17-Jan-24 8:24 
GeneralRe: user data system for a web-based e-mail service Pin
Richard MacCutchan17-Jan-24 22:55
mveRichard MacCutchan17-Jan-24 22:55 
GeneralRe: user data system for a web-based e-mail service Pin
RedDk18-Jan-24 8:08
RedDk18-Jan-24 8:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.