By tag: Singleton
0
kicks
Are Static Variables in Base Classes Shared In Derived Sub Classes?
Development Gotchas - Something that caught me out recently is the behavior of static variables in C# classes, and how they behave in derived classes. Also how does this differ with static variables in Generic<T> base classes? Finally, we use this understanding to create a generic base Singlet...
0
kicks
Design Patterns - Generic Singleton Pattern
A little follow up from yesterday ’s Singleton Pattern, where I asked for some help on how you would approach a generic singleton. With the help of Andrew Stevenson and ExNihilo, we came up with the following Generic Singleton Pattern.
0
kicks
Design Patterns - Singleton Pattern
Today we’ll have a look at a well known pattern, the Singleton Pattern. Most people have already heard about this one.
The definition: “Ensure a class has only one instance and provide a global point of access to it.“
0
kicks
Static Singletons for ASP.NET Controls
When building generic ASP.NET Server controls that also provide a sort of API service to other custom controls or page level code, it's often necessary to ensure that only a single instance of a control exists, and that only that single instance of this control or component can be accessed in the co...
0
kicks
C# - Singleton Pattern vs. Static Classes
Problem: Store some common data in a singleton or static class about your program in an object array, which you store in a class. It saves state between usages and stores some caches, and must be initialized only once and shared in many code locations. Making a new object each time would be expensiv...
0
kicks
Singletons are boring, hence factor out the concern (with a twist)
The umpteenth pattern to singletons...I know you've seen it by the gross ton.
Anyway, I just wanted to add a twist with the implicit operator and here you find the result.
0
kicks
C# singleton snippet
I've decided to stop the copy-paste madness.
Not that I use singletons so very often, but still - It never changes, so lets use a snippet.
0
kicks
Singleton C# code snippet
A complete documented and attributed singleton C# code snippet.
Highly recommended. 5 key-strokes for a singleton.
0
kicks
What's wrong with this code? #1 - Discussion
Discussion over the thread-safe singleton snippet presented in "What's wrong with this code? #1"
0
kicks
How to Use the Singleton Pattern and the Garbage Collector to Manage a
Here's an easy to minimize the overhead of an expensive resource, such as an image or a network connection, using the singleton pattern and some simple hints to the garbage collector.
0
kicks
When is a singleton not a singleton? Serialization!
How to prevent a singleton class to be instantiated multiple times when deserialized.
0
kicks
.NET interview question - when is a singleton not a singleton
A tricky interview question about duplicated singleton instances.
0
kicks
Design Patterns: Thoughts on the Singleton Pattern
Thoughts on the Singleton Pattern (Executive summary: Don't!)
0
kicks
.NET Remoting Use-Cases and Best Practices
Most people who don't know me personally assume that I value .NET Remoting above all other means of developing distributed applications. They might also assume that I'll use Remoting as a catch-all solution to any distributed application.