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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:59:15+00:00 2026-06-04T05:59:15+00:00

Lets imagine: // assembly 01 abstract class Foo { abstract void Bar(); } class

  • 0

Lets imagine:

// assembly 01

abstract class Foo
{
    abstract void Bar();
}
class AdvancedFoo : Foo
{
    override void Bar() { base.Foo(); ... }
}
sealed class SuperiorFoo : AdvancedFoo
{
    override sealed void Bar() { base.Foo(); }
}

And then I want to reference that assembly 01 from my 02 asm and replace the intermediate base class (and only it) so the instances of a SuperiorFoo were acting like they are inhereting from assembly 02‘s AdvancedFoo.

// assembly 02

class AdvancedFoo : Foo
{
    override void Bar() { base.Foo(); ... }
}

Is there any way to do that by not rewriting the SuperiorFoo class declaration if the 02 assembly?

var supFoo = new SuperiorFoo();
supFoo.Bar(); // This one should call assembly 02's Bar();
  • 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-04T05:59:18+00:00Added an answer on June 4, 2026 at 5:59 am

    Not in the way that you are doing no, but you could possibly use composition rather than inheritance to solve your issue:

    interface IFoo
    {
        abstract void Bar();
    }
    class AdvancedFoo : IFoo
    {
        override void Bar() { base.Foo(); ... }
    }
    sealed class SuperiorFoo : IFoo
    {
        private IFoo _fooImplementer;
    
        public SuperiorFoo()
        {
            _fooImplemnter = new AbstractFoo();
        }
    
        public SuperiorFoo(IFoo fooImplementer)
        {
           _fooImplementer = fooImplementer;
        }
    
        void Bar() { _fooImplementer.Foo(); }
    }
    

    To call from your second assembly, you would use the second constructor, passing an instance of your new ‘advancedfoo’ class.

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

Sidebar

Related Questions

Lets imagine a class class Foo: IDisposable { Dispose() { //Dispose of nonmanged resources.
Let's imagine I already have a project building .NET 3.5 assembly. Now I want
Imagine I wish to create (or overwrite) the following file :- C:\Temp\Bar\Foo\Test.txt Using the
Lets imagine I've written a custom actions managed class library that I am planning
Lets imagine function like this: function foo(x) { x += '+'; return x; }
Let's imagine I want to make a templated function that returns the first element
Imagine a simple case like this: class Book has_many :chapters end Let's say in
Lets say I have this code: <?php class hello { var $greeting = hello;
ok im a newbie on sessions lets imagine that we have a little login
I'm want to make code that reads assembly instructions (x86 only) and recreates them

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.