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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:38:46+00:00 2026-06-14T10:38:46+00:00

I am trying to get a better pattern / technique for this problem: I

  • 0

I am trying to get a better pattern / technique for this problem:

I have some set of criteria enums say X,Y,Z and I have a process that should produce different outputs/results based on given combinations of the given criteria.

The combinations are defined as a set of rules, for example:

rule_B = new Rule(X.Value1, Y.Value3, z.Value2);
rule_A = new Rule(X.Value2, Y.Value1, z.Value3);

each rule defines a unique combination of the criteria, and not all combinations may have rules (because some combinations may not make sense). The rule instances are not functional they are simply containers to store each factor into a unique combination.

My problem is how do I execute a specific set of processes using a single public interface class, such as:

class RuleExecutor {
    public void ExecuteBasedOnRule(Rule rule) {
        // Here is where I am stuck!!!!!!
    }
}

What sort of design pattern / technique could I use to execute 3 steps 1 for the value of X, one for the value of Y, and one for Z inside the RuleExecutor, each performing a different process based on it’s step value. In C++ I would maybe have used template specialization but C# doesn’t appear to help me there.

Note: In this convoluted example there are 3 factors with a small set of possible values, in the project I am looking to do these are quite large and creating a concrete class for every possible combination is not something I would consider lightly!

  • 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-14T10:38:47+00:00Added an answer on June 14, 2026 at 10:38 am

    Command pattern seems suitable.
    You can have 2 steps of execution:

    1. Configure your RuleExecutor with the required Rule.
    2. Run the ExecuteBasedOnRule method of RuleExecutor. The method should parse the stored config and act according to the data.

    Thus, I would define an interface with 2 methods: config(Rule) and execute().

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

Sidebar

Related Questions

I am trying to get a better working knowledge of JavaScript. So, I have
I'm trying to model a certain process and I'm thinking that the State Pattern
I'm trying to get a better handle on using sockets asynchronously. According to this
I am trying to get better about minimizing any unnecessary markup and using optimal
I'm a C programmer and trying to get better at C++. I want to
I'm trying to get a better understanding than I've been able to so far...it's
Just trying to get diff to work better for certain kinds of documents. With
I'm trying to automate the build process for engineering group. As part of that
I am trying to get a better understanding about insertion speed and performance patterns
I am trying to find a better way to handle some growing if constructs

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.