Great, then we are on the same page, just arguing about emphasis. The problem is, I don't think this idiom and its dangers are well understood, or even well documented.
-j ------------------------------- Jesse Liberty, President Liberty Associates, Inc. .NET Programming and Training http://www.LibertyAssociates.com > > > > The only place it does make sense to me to use this idiom is when > > > > a) the object is created in a very controlled situation (a > single method) > > and does not leave that method > > b) the object contains a very limited resource > > c) you know when you are done with the object > > d) you are making a LOT of instances > > Yes. So GDI+ resources and DB connections would seem to meet these. You > usually obtain and then release these in a single method, they are usually > expensive, and you do make an awful lot of them. (At least one every time > your app has to paint itself or your web app needs to show a page.) > > > As for its utility elsewhere... Well I've not used it for much > else, I have > to admit. But I use it an awful lot in the two scenarios I describe. > You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.