I have classes that contain other classes and containers of classes (ArrayList, Hashtable). Well I know that GC will destroy them all but is it a good style in .NET to create destructors? And will it improve even a little bit the process of destoying objects?
I don't think so. Moreover, I think it is a bit dangerous. For example, if you in destructor close a dataabse connection. In my opinion releasing methods should be called explicitly, for example db.disconnect instead of implicitly disconnect from the destructor.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.