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

  • Home
  • SEARCH
  • 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 6182001
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:07:37+00:00 2026-05-24T01:07:37+00:00

I am working on some OLD (as in older than me) C code that

  • 0

I am working on some OLD (as in older than me) C code that needs to be cleaned up and brought up to date so that (amongst other things), it is easier to maintain and integrates more cleanly with current code.

The existing code is quite messy, and freely intersperses GUI logic with business logic and data access logic. The only saving grace is that it is NOT spaghetti code, and that it is modular (as most code from the seventies tends to be).

My question is this: Can anyone provide me with a guideline on how to go about refactoring the code into MVC (BTW I am also moving the code from C to C++ whilst undertaking this task – but that is the least of my concerns, as I am quite aufait with both languages).

BTW, I am fully aware that this is not a trivial task. I just want to know what the steps are from going from modular code that mixes DBAL/BL/GUI to a cleaner MVC implementation.

  • 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-24T01:07:37+00:00Added an answer on May 24, 2026 at 1:07 am

    I’m not convinced that there can be a definitive set of steps, what we do will vary with the structure of the existing code.

    I agree with @Jesus Ramos that figuring out a test strategy is key here. The problem for you is likely to be that the code is currently not unit-testable, because there are effectively no “units”, we can’t test the business logic,say, without testing the UI.

    I would give very serious consideration to rewriting the the thing rather than refactoring.

    If you are going to refactor, then my guess is that you’ll take a kind of “Swiss Cheese” approach. Drill out pieces, leaving a central mass with lots of holes. So pull out database access code, focusing on providing a clear API and set of Data Objects – these become the basis of your Model. Pull out the GUI code into a view layer. What’s left is the Controller logic, which you can then refactor.

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

Sidebar

Related Questions

I just modified an older code and now nothing seems to be working. Could
New to php .I'm working on an old code in which I have to
I'm working on an old site and i would avoid searching&replacing and i was
we are going to be working with an old database. so it is very
Why are there no up to date tutorials books, or anything like that online
I'm working with the MVVM pattern + a simple ServiceLocator implementation, now to my
I'm working with 3D mesh data, where I have lots of 3D triangles which
We sell packaged Java web applications to some of our customers. It's basically a
I am working on overhauling the URL structure of review pages, which can be
I have a Subversion working copy with at least one missing file (the local

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.