in Education by
I don't develop too many desktop / Windows Forms applications, but it had occurred to me that there may be some benefit to using the MVC (Model View Controller) pattern for Windows Forms .NET development. Has anyone implemented MVC in Windows Forms? If so, do you have any tips on the design? JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
What I've done in the past is use something similar, Model-View-Presenter. [NOTE: This article used to be available on the web. To see it now, you'll need to download the CHM, and then view the file properties and click Unblock. Then you can open the CHM and find the article. Thanks a million, Microsoft! sigh] The form is the view, and I have an IView interface for it. All the processing happens in the presenter, which is just a class. The form creates a new presenter, and passes itself as the presenter's IView. This way for testing you can pass in a fake IView instead, and then send commands to it from the presenter and detect the results. If I were to use a full-fledged Model-View-Controller, I guess I'd do it this way: The form is the view. It sends commands to the model, raises events which the controller can subscribe to, and subscribes to events from the model. The controller is a class that subscribes to the view's events and sends commands to the view and to the model. The model raises events that the view subscribes to. This would fit with the classic MVC diagram. The biggest disadvantage is that with events, it can be hard to tell who's subscribing to what. The MVP pattern uses methods instead of events (at least the way I've implemented it). When the form/view raises an event (e.g. someButton.Click), the form simply calls a method on the presenter to run the logic for it. The view and model don't have any direct connection at all; they both have to go through the presenter.

Related questions

0 votes
    I don't develop too many desktop / Windows Forms applications, but it had occurred to me that there ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 23, 2022 in Education by JackTerrance
0 votes
    How do you implement Forms authentication in MVC?...
asked Apr 5, 2021 in Education by JackTerrance
0 votes
    If member does not implement serialization, which exception would be thrown? (a) RuntimeException (b) ... and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    I'm building an application with C# code. How do I get only the date value from a DateTimePicker ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 7, 2022 in Education by JackTerrance
0 votes
    We have created a web application, using ASP.NET, that allows users to upload documents and attach them to ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 16, 2022 in Education by JackTerrance
0 votes
    How would you deal with slow application complaint from clients?...
asked Jun 11, 2021 in Technology by JackTerrance
0 votes
    Mention & explain the different approaches use to implement Ajax in MVC?...
asked Jun 14, 2021 in Technology by JackTerrance
0 votes
    radha is a professional photographer and is working with the multinational photo printing company which device would radha ... forms? Select the correct answer from above options...
asked Dec 24, 2021 in Education by JackTerrance
0 votes
    I know how to do custom drawing of a standalone Windows Forms ScrollBar because there are plenty of examples ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 17, 2022 in Education by JackTerrance
0 votes
    Write any two Application where you would like to apply AI in your home ? Select the correct answer from above options...
asked Dec 19, 2021 in Education by JackTerrance
0 votes
    Suppose you need to perform a mobile application testing, what would be the facts you will take into consideration while selecting the test automation tool?...
asked Feb 9, 2021 in Technology by JackTerrance
0 votes
    What is difference between MVC and Web Forms?...
asked Apr 5, 2021 in Education by JackTerrance
0 votes
    If you want to build enterprise ASP.NET MVC applications that use MSSQL databases is it better to use Windows ... integration, etc)? Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    As a preface: I want to do this as a learning exercise. I'm not trying to produce a commercially ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 26, 2022 in Education by JackTerrance
0 votes
    As a preface: I want to do this as a learning exercise. I'm not trying to produce a commercially ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 23, 2022 in Education by JackTerrance
...