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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:20:33+00:00 2026-06-17T19:20:33+00:00

Alright, so a way with getting around with multiple-inheritance in C# is through the

  • 0

Alright, so a way with getting around with multiple-inheritance in C# is through the use of interfaces. Though this is a fair solution, it still requires you to always retype the methods within an interface that aren’t really supposed to change between the classes.

For example, if I have a method .foo() as part of the interface Adabo that is always found to do the same thing (say, it loops 10 times), but at some point of development I find out that I need to make a change to it (say, it is actually supposed to loop 11 times), I’ll have to go through each class that inherits from Adabo and change their own .foo() accordingly.

The only thing I want with interfaces is their free pass at multiple-inheritance, frankly. I’m not really interested in their all-abstract premise. Is there a way to get around this?

  • 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-17T19:20:35+00:00Added an answer on June 17, 2026 at 7:20 pm

    Without context, this is a difficult question to answer. Depending on the context, different solutions will be more appropriate than others.

    Firstly, as noted elsewhere – interfaces do not specify implementation, they specify only a contract. The implementation will be contained in some base class. A class can implement many interfaces, but the real question you have (I believe) is; “how can I implement many interfaces in a C# class whilst limiting code duplication, given that multiple inheritance is not possible?”.

    There are many options, and the context is important. However, some general principles which you could research further;

    • Object composition; having one class made up of several others. For example, a class car class could comprise several wheels, an engine, doors, etc. And the wheel class could be reused on a class Bus
    • Cross cutting concerns/Aspect oriented programming; more appropriate when it is a particular behaviour that you want to duplicate, rather than a concrete concept. The canonical example is tracing/logging; you want all methods to log without having to duplicate the logging calls everywhere. There are excellent tools to support this in C# such as PostSharp, but this approach requires a different design mentality to ‘traditional’ OO design.
    • Extension Methods; this is a .NET construct that be quite handy when you want to implement a behaviour for a type without actually modifying that type. The best example here is LINQ; all implementations of IEnumerable can use LINQ methods without actually directly implementing anything.

    As I stated, context is important, and without it, these are just general pointers that might serve you in some further research.

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

Sidebar

Related Questions

Alright so is there any way to make this program randomly change the variables
Alright, this problem seems to be way above my head! I have this code:
I'm still new to JQuery, on the way to getting my ajax example to
Alright I have way to much time invested in this. I am new to
Alright, I know there's a simple way to do this, but it's been years
Alright with the way below it is extracting only referring url like this the
Alright now, I have been searching everywhere for a way to accomplish this and
Alright, I hope I can phrase this in a way that makes sense. If
Alright, I'm pretty sure that this has been discussed before in some way or
Alright everyone, is there a way to have 2 divs taking up 50% of

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.