Posts

Showing posts from February, 2018

Juice this "static" up a little

    Static members and methods are basically the same as a non-static members and methods, but there is one difference: you don't need an instance variable to access them. For example, if you have a static class that is named HelperClass  that has a public method named DoStuff , you call the method as shown in the following example: HelperClass.DoStuff()     For more information about statics see " Static Classes and Static Class Members (C# Programming Guide) ".     The good about statics: single point data manipulation less memory usage (no instances) faster access/call times (the compiler generates overhead for non-static members and methods) low level of code complexity     The bad about statics: statics limitations (no inheritance, no overriding, can't use non-statics, etc.) code rigidity harder to test no control over the life cycle (remains in memory for the lifetime of the application domain) ...