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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:11:09+00:00 2026-05-28T19:11:09+00:00

Is there an app or website where I can input parameter info (types and

  • 0

Is there an app or website where I can input parameter info (types and variable names), their defaults, and have it generate all the combinations of method overloads?

I have a class where the constructor can take in five parameters of different types. The parameters get mapped to properties, none of which have public setters. Each parameter has a default value.

I want my class to have overloaded constructors for all the various combinations of the parameters (ranging from no parameters to any and all combinations of the five parameters). To make it more confusing, one of the parameters can be passed in as a specific type or as a string, and I want the various combinations of overloads to take that into consideration.

Update:

I agree this design may not be the best. The class in question is one I’m using in a similar fashion to the PropertyMetadata class of WPF’s DependencyProperty. A value is assigned for the property backing, and a new instance of the metadata class is passed in at that time. It’s forcing my hand to create this cascading series of constructor overloads. Example:

private ModelProperty<UserModel, string> firstNameProperty =
  RegisterProperty(p => p.FirstName, new ModelPropertyMetadata(**** lots of overloads here ****));
public string FirstName
{
     get { return GetValue(firstNameProperty); }
     set { SetValue(firstNameProperty, value); }
}

Maybe that’s not the best design. I could possibly extend ModelPropertyMetadata to new classes which describe specific overloads, but that just seems like its pushing the problem somewhere else. Any thoughts on how to make this design better?

  • 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-28T19:11:10+00:00Added an answer on May 28, 2026 at 7:11 pm

    Take a look at optional parameters – these should help you avoid multiple overloads and still provide multiple ways to call a constructor. This is a .NET 4.0 feature.

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

Sidebar

Related Questions

Apple's developer website describe 3 types of background services an app can use, music,
Is there an app that can change the order of images inside an icon?
In my app there is requirement that..I have 6 buttons in a nib, when
Is there a good Django app out there that can take a list of
I have an iPhone app out there that calls home to my server every
I have a windows application which is published on a website and can be
I'm developing a website. I'm using a single-page web-app style, so all of the
I have a main website app written in ASP.NET's MVC 3. Now, what I
I have a website where users can create lists and add items to these
I want to make an HTML/Javascript web app. Is there a website where I

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.