Click here to Skip to main content
15,885,729 members

Comments by Rob Bryce (Top 4 by date)

Rob Bryce 8-Apr-11 11:22am View    
http://msdn.microsoft.com/en-us/library/b1yfkh5e(v=VS.100).aspx Again, requiring Dispose instead of Finalize is an implementation detail. Agreed there are uses for Dispose, but in a general case, Finalize appears to provide your clean-up (release resources) AND hide that implementation detail.
Rob Bryce 8-Apr-11 10:22am View    
The native code is, in fact, simply a wrapper. To walk along the ordered set of these objects, the client managed code would make a call to Managed_eh->Next (not show in the original code block).

To implement this call would be Managed_eh->n_this->Next->gc_this. If the managed wrapper itself maintained next & prev pointers, then it would then no longer be a wrapper...
Rob Bryce 8-Apr-11 10:20am View    
The answer is simple: to follow the object-oriented methodology, you should be hiding all implementation details from the user. The fact that it contains/wraps a native object is an implementation detail that should be hidden from the user when it can be (i.e., when it doesn't encapsulate a system resource, for example.)
Rob Bryce 8-Apr-11 10:18am View    
Sorry, my bad, learning...