Posted By: Blkbam | Nov 15th, 2005 @ 1:26 PM
page 1 of 1
Comments: 5 | Views: 5458
Blkbam
Blkbam
Bam, Bam! Bam, Bam Bam!
A recent discussion here at work about Binary Compatability sparked my memory about being able to programatically depreciate a method in .Net however I can't seem to remember where I saw it.  I know I saw it happen in a video possibly here or in a MSDN Webcast but I'm not sure where.  Anyone have any ideas on how to do this?
Maurits
Maurits
AKA Matthew van Eerde
Blkbam wrote:
being able to programatically depreciate a method in .Net


If you're searching, you might have better luck with "deprecate" (no "i")
ScanIAm
ScanIAm
On a scale of 1 to 10, people are stupid.
Now, see if you can figure out how to amortize it over the lifetime of the application....
Maurits
Maurits
AKA Matthew van Eerde
ScanIAm wrote:
Now, see if you can figure out how to amortize it over the lifetime of the application....


*snort*

But seriously, I wonder if having Obsolete() take a date as an optional second parameter would be a worthy feature (after the date the function would error)
stephbu
stephbu
Error and Omissions Excluded

I'm not sure that setting a date (in compiled "stone" in the binary) would necessarily be a good choice for most systems.  Generally you'd want a more determinate environment where concrete actions like installing or uninstalling determines programmatic behaviour.

To this extent ObsoleteAttribute is a 'softer' compile-time error construct, with no direct runtime ramifications.  (Though of course these are normal reflectable attributes)   Instead assembly versioning effectively manages your code's 'lifetime'.  When the method signature no longer exists you get your error.  No ticking timebombs of badly chosen dates being embedded in a sealed library that you don't own.

page 1 of 1
Comments: 5 | Views: 5458
Microsoft Communities