Jay B. Harlow said:
IMHO the "set of rules" remains constant, by "set of rules" I mean JD's
three rules which are rather simple. IMHO my list of 3 are more
mantalities for managing JD's three rules...
What would change is the list classes that now either "require" or not
"require" dispose changes. I would expect classes that went from not
requiring Dispose to now requiring Dispose to directly or indirectly to
show up under the "Profiling & various exceptions" clause of my 3 rules...
IMHO, the "set of rules" you refer to are not rules at all; they are
patterns of usage. A rule would tell you, quite simply, "use Dispose() on
object x in situation y" or "don't use Dispose() on object x in situation
z". The "rules" I alluded to are the specific recommendations on usage
using pattern #3.
And I see we didn't even address my question, which is quite simply - and to
use your terms - when the "profiling & various exceptions" clause is
updated, how much time will be spent researching this, updating your usage
patterns, and finally updating any code you've currently completed?
It sounds to me like, to use pattern #3, you have to:
1) Perform a lot of research to determine the Developer's Recommendations,
2) Perform a lot of research to figure out the "various exceptions",
3) Potentially spend a whole lot of time researching and adjusting your code
when the Developer Recommendations change.
From what you and others have posted, this esoteric information on Dispose()
usage is gained through trial and error, from others, and of course
developer recommendations. It appears that there is no definitive "list" of
"classes that now either 'require' or not 'require' dispose", and until
someone puts a definitive list together, it doesn't make a lot of sense to
reference it as if it were a click away. (BTW - If it *is* available, then
this whole thread can be boiled down to a simple link to this definitive
"list"... and shame on whoever knows the whereabouts of this list for not
posting the link already).
At this point I don't see a significant ROI on all this time and energy
spent on trial-and-erroring my way to this sliver of mysterious knowledge,
researching Developer's Recommendations on using Dispose() for every class I
use, or posting a new message every single time I run across an object that
exposes a Dispose() method. After all, I tested the third option with the
SqlCommand object in this thread days ago, and still haven't received a
simple "YES" or "NO" concerning whether or not it should be Disposed of!
Instead I get responses concerning "Labels" and patterns of usage: ("use it
all the time", "use it none of the time", "use it correctly")!
Imagine if you had to stop development for days each and every time you ran
across a new class that exposed Dispose(), so that you could post a
newsgroup message and await a response - which might or might not be
forthcoming. Alas, it's much simpler to consistently Dispose() of my
SqlCommand, SqlConnection and other objects when I'm done with them. I
would love to see a demonstration of how all the proposed research into this
arcane trivia generates anything greater than a personal sense of
accomplishment...
As I've stated before, VB.NET 2005 will get the same "using" statement
that C# has to help manage IDisposable classes...
Good, it's about time.
Maybe not in the way you think, but thank you nonetheless.