C
Carlo Razzeto
Hey,
Some one gave a new developer of ours a project to make sure our core
library funcitons are properly cleaning up resources (that's a good thing!),
but I had consernse about one thing the developer was doing which sparked a
debate with my co-worker.
Some of these functions were returning DataSet objects, and the developer
was calling the Dispose() function on the datasets inside the finally
portion of a try block. For me, this kind of raised a red flag, because it
seems to me the funciton is then returning an object which it has already
"cleaned up". In some cases an "end programmer" might even want to take this
dataset, modify datarow values and call a DataAdapter.Update() on it. It
just doesn't seem like a very safe practise to me.
Am I being overly cautious here? I guess I just have a problem with
returning "cleaned up" object in general, to me it seems like no good can
come from that. Thanks for your thoughts,
Carlo
Some one gave a new developer of ours a project to make sure our core
library funcitons are properly cleaning up resources (that's a good thing!),
but I had consernse about one thing the developer was doing which sparked a
debate with my co-worker.
Some of these functions were returning DataSet objects, and the developer
was calling the Dispose() function on the datasets inside the finally
portion of a try block. For me, this kind of raised a red flag, because it
seems to me the funciton is then returning an object which it has already
"cleaned up". In some cases an "end programmer" might even want to take this
dataset, modify datarow values and call a DataAdapter.Update() on it. It
just doesn't seem like a very safe practise to me.
Am I being overly cautious here? I guess I just have a problem with
returning "cleaned up" object in general, to me it seems like no good can
come from that. Thanks for your thoughts,
Carlo