Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 258449
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T22:10:54+00:00 2026-05-11T22:10:54+00:00

I am developing a desktop application with a MainForm that’s grown rather large. There

  • 0

I am developing a desktop application with a MainForm that’s grown rather large. There are lots controls in several containers on different levels (SplitContainers, TabPages, Panels).

Now I want to refactor this class by separating all the controller code responsible for data binding & clearing the controls or carrying out user interactions into separate Controller classes.

[EDIT]

Purpose

The purpose of this application is to track orders (called Job) and their positions (called Jobitem). Each Job is related to a customer, each Jobitem to an Article (Jobitems contain information that’s specific to the manufacturing process of its article, therefore it’s wrapping the article). Job, Jobitem, Customer and Article have dynamic properties (basicalyl key/value pairings) which are managed by a PropertyManager class.

Architecture

My application is split into 2 main projects: The core contains the data model in 3 LinqToSQL DataContext Classes:

  • ArticleManagement
  • JobManagement
  • PropertyManagement

For every DataContext class there is a XyzManager class which provides the LinqToSQL Object in a Collection to the GUI, encapsulating the LinqToSQL data source. It also handles creation, deletion and modification to its corresponding DataContext types.

Then I’ve got a GUI project, naturally containing a main form and some additional forms for stuff like options etc. As of now, my GUI project holds a reference to each XyzManager class and gets & sets the data through the Manager classes as the user interactions dictate, containing all the controlling logic.

I’ve put most of the independent logic for this into a static Utility class outside of the main form class, but that’s an less than ideal approach I guess.

[/EDIT]

This is my first bigger Desktop Application and I am having a hard time encapsulating the GUI. As of right now, all the controller code responsible for handling user interactions resides within the MainForm class.

I know about the MVC pattern but I’m not sure how to apply it on a C# WinForm with my current design.

My custom code alone is over 2400 lines of code long, not counting in the automatic generated code of the form, with a rising tendency. I want to refactor this, but am lost as to how I could solve this in a more elegant fashion.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T22:10:54+00:00Added an answer on May 11, 2026 at 10:10 pm

    For small scale applications you should take a look at Model-View-Presenter (MVP), there is a good presentation of the (in my opinion) best way to do MVP:
    http://martinfowler.com/eaaDev/SupervisingPresenter.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 124k
  • Answers 124k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Are you running on OS 3.0? I saw the same… May 12, 2026 at 1:19 am
  • Editorial Team
    Editorial Team added an answer It looks like you need to register Apache::Session::Memcached with Apache::Session::Wrapper,… May 12, 2026 at 1:19 am
  • Editorial Team
    Editorial Team added an answer Use DATENAME or DATEPART: SELECT DATENAME(dw,GETDATE()) -- Friday SELECT DATEPART(dw,GETDATE())… May 12, 2026 at 1:19 am

Related Questions

I am developing a desktop application with a MainForm that's grown rather large. There
I am relatively new to C#/.Net. I'm developing a desktop application that requires multi
Hey I am developing an desktop application using Spring and Hibernate, and I have
I am using a quad-core windows XP based Dell Machine machine in my office
I'm looking to develop an offline version of an application that still needs to

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.