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 7654789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T12:20:47+00:00 2026-05-31T12:20:47+00:00

I have an extremely basic Windows Forms app for data capture and reporting on

  • 0

I have an extremely basic Windows Forms app for data capture and reporting on microloans. I have done a pretty good entity model design using EF, but only some initial prototyping with data access via the EF as well as business logic inside Windows Forms methods. I want to now ‘formalise’ the app a bit, and concentrate on writing only UI logic in the forms themselves.

I’m wondering what structures and patterns I can use here? I am used to using a loose repository pattern and view model setup for my MVC3 projects, but haven’t done much winforms work for a few years and am unsure. Some recent reading suggests a repository should purely do CRUD, which would make using one here superfluous and excessive. I don’t want to go as far as a full-on MVVM or MVP design, but I’m stuck wondering where to put what.

The most apparent structure that emerges for me is to extend my entity model to include business logic and operations, e.g. add an AllocatePayment method to the Client class, to allocate a payment made by a client over outstanding loans for the client, and so forth, but this doesn’t smell quite right. Even worse is the looming LoanManager type monolith class, with static methods for everything.

How can I nicely refactor this prototype into a presentably structure app design? I would like to incorporate a TDD approach now, before beginning the refactoring. It seems this will help inspire better low level design of whatever class structures I decide on.

  • 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-31T12:20:48+00:00Added an answer on May 31, 2026 at 12:20 pm

    Domain model pattern is quite fine if implemented not as static but as an instance methods. All you objects have its states and some specific behavior.

    That’s about where our domain logic should be. In this way unit testing can be written easy. You create an object with some state. Call method and verify if you expectations are met.

    Persistence can be done with either ActiveRecord / Repository / DataMapper
    I don’t really like ActiveRecord because it violates the single responsibility principle, but it’s my own preference.
    There is a great discussion of each particular pattern in Fowler’s EAA and here

    To simplify I would go with some sort of already done solution like CastleActiveRecord or implement straightforward Repository.
    There is a great post on what repository can look like nowadays

    So one option is to make your model containing your business logic. Implement repository / entity responsible for persistence. Forms should only represent your model. And controllers can serve user actions as there is only a finite set of them.

    Just in case: data binding is a great feature of WinForms that allows to associate almost any data with controls with zero code.

    If there are any restrictions that should be met by your architecture it can be a point of a discussion as each one has its own pros and cons. But MVC pattern is here with us since 80s’ and its audience is only getting wider 🙂

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

Sidebar

Related Questions

I have this extremely basic jQuery UI Modal Dialog that I wrote for testing
I have an extremely basic example of this here . To replicate, try submitting
I have the following extremely basic $.ajax function: function doAjax(url, args){ var retVal =
I have no idea why this extremely basic piece of code sets null values.
I feel I am missing something extremely basic; yet I have spent hours to
I have an extremely simple web application running in Tomcat using Spring 3.0.2, Hibernate
I am currently learning F# and have tried (an extremely) simple example of FizzBuzz.
We have a client who desires some extremely long pages. Say 4000px plus. They
I have a SQL script which is extremely large (about 700 megabytes). I am
I'm extremely new to JS and have this code that I'm trying to tweak.

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.