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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:11:30+00:00 2026-05-25T21:11:30+00:00

I’m rewriting a beast of a program that does everything and it’s kitchen sink.

  • 0

I’m rewriting a beast of a program that does everything and it’s kitchen sink. It’s a phone IVR system (press 1 to blah blah, press 2 to…) I’ve got all of it’s functions divvied up into their own projects, however my one biggest pain point comes right when we first answer the phone and have the user enter a code that lets us know what system to dispatch the caller to.

The whole code system is a mess TBH, but it can’t be changed, and I’ve refactored about 800 lines of VB6 down to something that resembles the following code:

string code = foo.GetAccessCodeFromCaller();
if (DatabaseCheck1(code)
{
    parse = ParseCode(code);
    dbValue = GetSomethingFromDB(parse);
    if (OtherCheck1(dbValue)
    {
        // Launch the Pay Taxes project.
    }
    else if (OtherCheck2(dbValue)
    {
        // Launch the Uploaded File project
    }
    else
    {
        // Schedule Something or other project
    }
}
else if (LookForSomethingElseInDB(code)
{
    parse2 = AltParseMethod(code)
    if (Conditional(parse2))
    {
        if (LargeChunkOfCodeConditional(code))
        {
            // Report a something or other project.
        }
        else
        {
            // Talk to Tech Support.
        }
    }
    else
    {
        // Invalid Input
    }
}
else
{
    if (YetAnotherChunkOfCode(code))
    {
        // Order products project
    }
    else
    {
        // Invalid Input.
    }
}

I need a good architecture to get this system done right, where right equates to being highly adaptable to getting more crap shoe horned in to it. The original system was done in VB4/5, and lasted through over 16 years of near monthly changes. I want something that’ll keep this mess orderly and make it easy to add crap to for the next 16 years.

So far I’ve tried a few patterns (Visitor, and Command), but nothing seems to be a good fit the way I tried to implement it. Any suggestions here would be very appreciated.

EDIT:
To be a bit more clear my current architecture has a solution with the following projects: Dispatch, PayTaxes, UploadedFiles, ScheduleSomething, ReportSomething, TechSupportRedirect, OrderProducts ect… (along with HardwareAbstraction, SharedInterfaces, and DatabaseAccess projects). Dispatch uses the HardwareAbstraction project to answer the phone and ask for the callers code, then routes the call to one of the other 10 projects that perform wildly different tasks (and can then be rewritten in parallel by 10 different developers without toes getting stepped on).

I can figure out the architectures of the destination projects well enough, but the actual Dispatch project is tripping me up. Also if my whole solutions architecture is some sort of anti-pattern someone let me know before I get too far.

  • 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-25T21:11:31+00:00Added an answer on May 25, 2026 at 9:11 pm

    I don’t know anything about VB6, but how about mapping the codes to “delegates” (dunno if that concept exists in VB6). The idea is: the input-code is a “key” to a dictionary returning the method to invoke (or Empty/Null/Nothing if no such code found).

    UPDATE:
    If this is written in C#, couldn’t you just put the codes into a

    Dictionary<string, Action> OpCodes;
    

    Then do something like:

    if(OpCodes.ContainsKey(code))
      OpCodes[code]();
    

    UPDATE 2:
    It seems you have “layers” of conditionals. I guess this would map to “Dictionaries of dictionaries”. But thinking about the problem: User types a sequence of choices, which should wind up in a certain behaviour, sounds like: Define “delegates” for each system behavior, and map to codes:

    Like:

    OpCodes["123"] = new Action(TechSupport.StartConversation);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a French site that I want to parse, but am running into
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
Does anyone know how can I replace this 2 symbol below from the string
i got an object with contents of html markup in it, for example: string
I need a function that will clean a strings' special characters. I do NOT

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.