Administrator
VB.NET Forum Admin
- Joined
- Jun 3, 2004
- Messages
- 1,462
- Programming Experience
- 10+
I'm curious of the impact of using shared (static) methods vs. instanced. Take for example I want to save a text file to the hard drive. I would use code such as Friend Shared Function WriteToDisk(byVal textData). It's simply easier than creating an instance of the class to access the method.
But what are the consequences? I'm mainly interested in memory, not threading issues. In a main application (EXE) or a class library (DLL) that serves only this EXE, is it really required to instance? My concern is memory, will memory just grow and grow or will it matter?
For libraries shared by my web apps I definitely make them instanced and implement IDisposable where possible. But I'm wondering if I'm walking down a path of memory issues to come by using Shared methods vice instanced.
Your thoughts on this "pattern?"
But what are the consequences? I'm mainly interested in memory, not threading issues. In a main application (EXE) or a class library (DLL) that serves only this EXE, is it really required to instance? My concern is memory, will memory just grow and grow or will it matter?
For libraries shared by my web apps I definitely make them instanced and implement IDisposable where possible. But I'm wondering if I'm walking down a path of memory issues to come by using Shared methods vice instanced.
Your thoughts on this "pattern?"