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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T04:00:37+00:00 2026-05-18T04:00:37+00:00

There is a design problem like this. Suppose you have a set of class

  • 0

There is a design problem like this.

Suppose you have a set of class that implements similar methods but not identical ones.

Example : The ClassA has methods like this.

void Add(string str);
void Delete(string str);
List<string> GetInfo(string name);

Another class, ClassB has the following methods.

void Add(Dictionary Info);
void Delete(string str);
Dictionary GetInfo(string name);

So the nature of the methods are similar but the return types/ input parameters are different. If I develop an interface to keep the consistency I can only define Delete operation there. Alternatively I can think about a set of independant class without any relationships with each other (Of course no interface implementations) but I don’t think it is a good design.

  1. What is the approach I can use to implement this?
  2. I am new to generic interfaces. Does it help in this case? If so I am going to learn and implement using them.
  • 1 1 Answer
  • 3 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-18T04:00:38+00:00Added an answer on May 18, 2026 at 4:00 am

    You can use generic interface here. An example:

    interface IModifiable<T>
    {
      void Add(T Info);
      void Delete(T item);
      T GetInfo(string name);
    }
    public class MyClass : IModifiable<List<string>>
    {
       public void Add(List<string> list)
       { 
          //do something
       }
    
       public void Delete(List<string> item)   {  }
       public List<string> GetInfo(string name)  {  }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My application I have an application design that looks like this: web application layer
I got the following problem. I have a design similar to this jsfiddle: http://jsfiddle.net/k3EUx/
Is there any design reason for that (like the reason they gave up multi
this is more a design question. Suppose you have many beans A, B, C....
Suppose I have a class that downloads a news feed from the web public
Suppose I have a class that represents a list of movies, belonging to a
I suppose everyone runs into this problem once in a while: you have two
In Algorithm Design Manual , there is such an excise 4-26 Consider the problem
Are there any known design principles, best-practices and design patterns that one can follow
There is a big design flaw here, but I'm having trouble solving it: The

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.