-
July 8th, 2013, 04:54 PM
#1
Why method Dispose from IDisposable is not virtual?
What is the reason behind that?Thanks.
-
July 8th, 2013, 11:44 PM
#2
Re: Why method Dispose from IDisposable is not virtual?
Why should it be virtual?
-
July 9th, 2013, 09:28 AM
#3
Re: Why method Dispose from IDisposable is not virtual?
Originally Posted by Arjay
Why should it be virtual?
Ok, maybe we can put aside virtual or non-virtual for the time being. There is another question that if a class implements IDisposable, why should the class have to implement the method Dispose from IDisposable? Thanks.
-
July 9th, 2013, 12:59 PM
#4
Re: Why method Dispose from IDisposable is not virtual?
Originally Posted by LarryChen
Ok, maybe we can put aside virtual or non-virtual for the time being. There is another question that if a class implements IDisposable, why should the class have to implement the method Dispose from IDisposable? Thanks.
Because that's how interfaces are designed and that's how an interface differs from using a base class or abstract base class.
Now if you are wondering why IDisposable has been implemented the way it is, why not use bing or google to help?
Try searching bing for "Why was IDisposable designed the way it is?"
http://stackoverflow.com/questions/2...-the-way-it-is
http://reedcopsey.com/tag/idisposable/
There is much on this subject, I'm wondering why you haven't found it yourself. Is your google kung fu that weak?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|