Legacy protected dispose pattern
See original GitHub issueDoes anyone have any information about why the protected dispose pattern is marked as “LEGACY” in this analyzer? It looks to me like using protected virtual Dispose(bool disposing)
aligns more closely with the suggested Dispose pattern that can be found on MSDN, so I’m not sure why it’s labeled as “legacy”.
Thanks 😃
Issue Analytics
- State:
- Created 3 years ago
- Comments:20 (5 by maintainers)
Top Results From Across the Web
Implement a Dispose method
The dispose pattern is used for objects that implement the IDisposable interface. This pattern is common when interacting with file and pipe ...
Read more >CA1063 when implementing the dispose pattern for a ...
Follow the Implementing the dispose pattern for a derived class guide and override the Object.Finalize method. using System; class BaseClass : ...
Read more >The Dispose Pattern - YouTube
The Dispose Pattern is the be-all and end-all of resource deallocation - which is why we almost never use it. Many thanks to...
Read more >Do I really need to implement Dispose(Boolean)?
It comes with a Dispose(Boolean) and a Dispose() method, while the Finalize() method is commented, suggesting it is the only thing that is ......
Read more >Using, IDisposable & Finalizers - Elements Docs
The Disposable Pattern, centered around the IDisposable interface, can be used to add deterministic disposal of resources that are not managed by the ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think I prefer LEGACY as it indicates that it is not the preferred pattern by this opinionated analyzer.
My thinking is that full could be interpreted as this is what you want if you want to do it properly.
@Bosch-Eli-Black the analyzer encourages the use of a newer and much simpler pattern over the pattern originally developed, leveraging best practices information learned in the meantime. I would recommend changing ‘legacy’ to ‘full’, but without question would continue to discourage its use. The only cases where the ‘full’ pattern makes sense are:
Form