C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Articles » .NET Framework »

Don't Burn Your Base Class


Posted Date: 18 Aug 2008    Resource Type: Articles    Category: .NET Framework
Author: avtarMember Level: Gold    
Rating: 1 out of 5Points: 2



Insights into the .NET Architecture
A Conversation with Eric Gunnerson
by Bill Venners with Bruce Eckel
February 9, 2004



Don't Burn Your Base Class
Bruce Eckel: Does the CLS allow multiple interface inheritance?

Eric Gunnerson: Yes.

Bruce Eckel: But that's a reasonable constraint.

Eric Gunnerson: It's a reasonable constraint if nobody causes you to do anything that makes you burn your base class.

Bill Venners: Burn my base class?

Eric Gunnerson: I'll give you the canonical example. When you want to make a component a remote object, you must derive its class from a base class called MarshalByRef. When MarshalByRef subclasses get marshaled, they get marshaled by reference. You get an object over here and a proxy over there, and the runtime handles all the mechanics. That works great, unless you actually want to use inheritance in your design. Because the designers of remoting decided to do this with the base class, they took the option of using inheritance in any other way away from you. They burned the base class.

Bill Venners: They burned the base class because if I want to remote something, I have to extend their class, not some other class I may want to extend.

Eric Gunnerson: Maybe you can get away with extending a class of yours that extends their class.

Bill Venners: But if it doesn't already extend their class and I can't change it, then I'm out of luck.

Eric Gunnerson: Yes, exactly. The constraint in supporting single inheritance of implementation, multiple inheritance of interface is that you have to pay a lot of attention about what you do. In fact if you go talk to customers that use remoting they say that exact same thing, why are you burning a base class here? You don't need to. You could use attributes or some other mechanism.

Source


For more details, visit http://www.artima.com/intv/dotnet.html



Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
Don't Burn Your Base Class  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: String Manipulation - Part 4
Previous Resource: Datetime Manipulation in Vb.net - Part 1
Return to Discussion Resource Index
Post New Resource
Category: .NET Framework


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use