Microsoft .Net Framework Interview questions and answers FAQ's, .Net 2.0, .Net 3.0, .Net 3.5, WPF - WCF, C#.NET, ASP.Net, VB.Net,ADO.Net, Web & desktop development questions.
Thursday, September 3, 2009
Is the lack of deterministic destruction in .NET a problem?
It's certainly an issue that affects component design. If you have objects that maintain expensive or scarce resources (e.g. database locks), you need to provide some way for the client to tell the object to release the resource when it is done. Microsoft recommend that you provide a method called Dispose() for this purpose. However, this causes problems for distributed objects - in a distributed system who calls the Dispose() method? Some form of reference-counting or ownership-management mechanism is needed to handle distributed objects - unfortunately the runtime offers no help with this.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment