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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T16:56:50+00:00 2026-05-29T16:56:50+00:00

I have been working on a project where I have a Worker class that

  • 0

I have been working on a project where I have a Worker class that generates a lot of data in a multi-threaded fashion. The type, size, and location of the data is variable based on a large set of parameters that can be set by an end user. Essentially this is a big test harness that I am using to investigate how certain things perform based on a variation of the data. Right now I have at least 12 different parameters for the Worker class. I was thinking about switching over to a separate WorkerOptions class that contains all of these values, and then have the UI create the WorkerOptions object and then pass that into the Worker. However, I could also expose public properties on the Worker class to allow the options to be set appropriately at Worker creation as well.

What is the best way to go about this, and why? I am sure this will generate some different opinions but I am open to listen to debate about why different people might do it a different way. Some things to consider are that currently once a Worker is created and running, its configuration doesn’t change unless it stops. This could be subject to change, but I don’t think it will.

EDIT
I am not a C# developer normally, I know enough to be able to write applications that function and follow common design patterns, but my expertise is in SQL Server, so I might ask follow up questions to clarify your meaning.

  • 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-29T16:56:54+00:00Added an answer on May 29, 2026 at 4:56 pm

    I’d combine the two approaches.

    Make your WorkerOptions class use a constructor that requires all the required parameters, and allows the optional parameters to be set either via an overload, optional arguments, or properties, then pass that in as an argument.

    Having the WorkerOptions class gives you a nice DTO to pass around in case refactoring leads you to create an additional layer between the UI and the worker class itself. Using required parameters in its constructor gives you compile-time checking to prevent runtime errors.

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

Sidebar

Related Questions

I have been working on a project that has 2 interfaces - windows forms
I have been working on a Java project for a class for a while
I have a project that I have been working on for a while, just
I have a django project that I have been working on as a solo
I have a console project that I have been working on. I added log4net
I have been working on a project that has common bits of functionality, specifically
Situation I have been working on a project lately where the UI development seems
So I have been working on this project for a short while now. I
I have been working on a web services related project for about the last
I have been working on a C# 4.0 WPF project and need to figure

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.