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

  • Home
  • SEARCH
  • 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 7925063
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T18:06:34+00:00 2026-06-03T18:06:34+00:00

Given web service method: public void FindSomeEntities(int? Id, string param1, int? param2, …) Refactored:

  • 0

Given web service method:

public void FindSomeEntities(int? Id, string param1, int? param2, ...)

Refactored:

public void FindSomeEntities(SelectionParameters selectionParameters)

class SelectionParameters
{
    public int? Id;
    public string param1;
    public int? param2
    ...
}

Pros:

  1. too many parameters in original web service method reduced to the
    only one
  2. if there is need to change we won’t have to change the
    interface of the method – only the definition of SelectionParameters

Cons:

  1. class SelectionParameters hasn’t any business value – it’s used only
    as helper class and it’s used in a single method. As a result we’ll
    have many methods with 1 parameters and plenty of one-off classes
  2. Actually the interface IS changed, we just push these changes a bit
    deeper.
  • 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-03T18:06:41+00:00Added an answer on June 3, 2026 at 6:06 pm

    This refactoring is called Introduce Parameter Object. It is likely to be a good idea if the parameters are naturally related to each other, and especially if they’re frequently used together as parameter lists to multiple methods.

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

Sidebar

Related Questions

Given the following Class and Service layer signatures: public class PersonActionRequest { PersonVO person
In my asmx file, I have [WebMethod] [ScriptMethod] public void Method(IDictionary<string, CustomClass> objectOfCustomClass) {
I'm looking for a general purpose API/web service/tool/etc... that allows convert a given HTML
I've created a web service , which can a method to set the user
Hey, I am trying to return a user defined class from a web method.
I am working on an ASMX web service; trying to create a method that
I am creating a WCF Web Service in which one method (exposed in Service)
Given: Multiple clients with a Service.asmx page that has some web methods that I
I am using the following class to connect to my web service. I would
I'm working with a web service that will give me values like: var text

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.