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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:23:01+00:00 2026-06-08T18:23:01+00:00

My application has many modules and the original business flow looks like this: A

  • 0

My application has many modules and the original business flow looks like this:

A -> B -> C -> D

As the application grows, alternative flows are added to satisfy customers’ need:

A -> B -> C -> D

A -> B -> C’ -> D (C now can perform optional operations)

A -> D

A -> D’ (D now can perform C’s optional operations)

The numbers of unit test cases and QC’s manual tests rocket.

Current I have 2 solutions:

  1. Silently create B, C from A before giving it to D, then I can guarantee the number of inputs to D
  2. Skip B, C, adjust the input of D to a mediate type and write Adapter to convert the A -> mediate type

The chosen solution must meet below objectives:

  • Flexible business (for customer)
  • High processing performance
  • Maintenance (source code)

I have no idea which one I should use or there is any better solution.

  • 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-06-08T18:23:02+00:00Added an answer on June 8, 2026 at 6:23 pm

    First, I am not entirely sure I understand your problem, so let me state my assumptions and then provide my answer. Adapt as necessary.

    Assumptions:

    • Your business process models sets of operations. Example: A could be a checkout step, and C and C’ be two different but similar payment steps.
    • Each of the process steps operate on separate parts of a common data set. Example: B calculates totals and discounts (operate on cart contents), and C and C’ take the totals and initiate some sort of payment.
    • You want to keep as much as possible of your existing implementation intact.

    If this is the case, I would ensure that I had a proper understanding of my data model, and which parts each of the steps would operate on, and then build a state machine around this.

    Benefits:

    • Each of your process steps can be modelled using one or more states. You ensure that transitions are based on the data model. You could have a decision state that based on the user’s decision of paying using Paypal or redeeming a voucher transitions you to the appropriate state to handle this.
    • States can be tested individually. Unit tests will be easy to write, and you can build harnesses for customer-facing functionality for manual testing (such as integration testing with a payment provider).
    • State machines usually have a low footprint. They are normally event-driven, and thus keep the thread-count down in your application. If states only contain logic and only operate on data objects, you can even reuse state instances across different concurrent processes. This depends on your state machine framework.

    Things to keep in mind:

    • Be explicit in your states, and have many small states perform small dedicated operations. If a decision to go with card payment or vouchers arises, model this in a pseudo state.
    • Avoid God objects (i.e. objects that contain know everything). If states start operating on large parts of the domain model, consider improving either the model or the state machine
    • Make sure to make everything event-driven and asynchronous. Synchronous state machines won’t scale. If you are calling services that are not asynchronous, build a wrapper for it.

    I have successfully employed this way of modelling a business flow in a previous project. It was a flow where end users could purchase objects. We needed to handle lots of alternative flows, such as switching between different ways of payment, retries when backend systems were unavailable and so on.

    We rolled our own state machine framework for this to suit our needs. You should probably look at what is available for your platform.

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

Sidebar

Related Questions

I have developed a java swing client-server application. The server has many services like
I'm doing web application for many users. Application will has many modules - register,
Our application has many controls that are created dynamically. For example, a navigation pane
My application has many classes, worker threads, and background service operations. Notifications can come
I have a multithreaded application that has many concurrent operations going on at once.
I'm currently working on a large and old C++ application that has had many
I'm building WPF client application. I'm following MVC pattern. The project solution has many
Consider a production planning application with many products. Each product has a list of
I am creating a web application that will have many users. Each user has
I have an application which has many services and one UI module. All these

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.