Why isnt ContextBoundObject an interface?

  • Thread starter Thread starter Brian Takita
  • Start date Start date
B

Brian Takita

Hello,

I was looking at the ContextBoundObject implementation and saw that this

class does nothing more than call the MarshalByRefObject's constructor
in its constructor.

That tells me that ContextBoundObject is some sort of marker that tells
the rest of the framework that the class that inherits it has a bound
context.

Unfortunately, c# only has single inheritance, which means you can't
inherit from a class and get the benefits of a ContextBoundObject.

Wouldn't an interface be a better choice? It would allow you to inherit
from another class while using ContextBinding.

Is this a "design choice" to force the developer to use aggregration if
she wants to use build upon a class that was not meant to be ContextBound?

Thank you,
Brian Takita
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top