Stories recently tagged with 'Singleton'

Are Static Variables in Base Classes Shared In Derived Sub Classes?(www.dominicpettifer.co.uk)

submitted by Sunday_IronfootSunday_Ironfoot(25) 1 year, 6 months ago

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 Singleton class. read more...

add a comment |category: |Views: 12

tags: another

Design Patterns - Generic Singleton Pattern(blog.cumps.be)

submitted by CumpsDCumpsD(360) 3 years, 6 months ago

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. read more...

add a comment |category: |Views: 43

tags: another

Design Patterns - Singleton Pattern(blog.cumps.be)

submitted by CumpsDCumpsD(360) 3 years, 6 months ago

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.“ read more...

add a comment |category: |Views: 17

tags: another

Static Singletons for ASP.NET Controls(west-wind.com)

submitted by rstrahlrstrahl(7226) 3 years, 7 months ago

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 context of an ASP.NET request. Using HttpContext and it's Item collection makes it easy to create reusable, cacheable instances and ensure you're only running a Singleton instance of it. read more...

add a comment |category: |Views: 17

tags: another

C# - Singleton Pattern vs. Static Classes(dotnet.dzone.com)

submitted by volume4volume4(910) 3 years, 7 months ago

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 expensive. read more...

add a comment |category: |Views: 85

tags: another

Singletons are boring, hence factor out the concern (with a twist)(realfiction.net)

submitted by fquednaufquednau(404) 3 years, 9 months ago

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. read more...

add a comment |category: |Views: 3

tags: another

C# singleton snippet(sharpregion.com)

submitted by yoavsionyoavsion(345) 3 years, 9 months ago

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. read more...

add a comment |category: |Views: 96

tags: another

C# singleton snippet(sharpregion.com)

submitted by yoavsionyoavsion(345) 3 years, 9 months ago

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. read more...

add a comment |category: |Views: 96

tags: another

Singleton C# code snippet(sharpregion.com)

submitted by AdrianAisembergAdrianAisemberg(1993) 4 years ago

A complete documented and attributed singleton C# code snippet. Highly recommended. 5 key-strokes for a singleton. read more...

add a comment |category: |Views: 171

tags: another

What's wrong with this code? #1 - Discussion(ekampf.com)

submitted by ekampfekampf(3195) 4 years, 6 months ago

Discussion over the thread-safe singleton snippet presented in "What's wrong with this code? #1" read more...

add a comment |category: |Views: 1

tags: another

How to Use the Singleton Pattern and the Garbage Collector to Manage a(jeremyjarrell.com)

submitted by jeremyjarrelljeremyjarrell(2685) 4 years, 9 months ago

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. read more...

add a comment |category: |Views: 18

tags: another

When is a singleton not a singleton? Serialization!(dotnetslackers.com)

submitted by simonebsimoneb(5450) 4 years, 9 months ago

How to prevent a singleton class to be instantiated multiple times when deserialized. read more...

1 comment |category: |Views: 45

tags: another

.NET interview question - when is a singleton not a singleton(dotnetslackers.com)

submitted by simonebsimoneb(5450) 4 years, 9 months ago

A tricky interview question about duplicated singleton instances. read more...

add a comment |category: |Views: 12

tags: another

ASP.NET Singleton-per-Page pattern(dotnetslackers.com)

submitted by simonebsimoneb(5450) 4 years, 9 months ago

Implementing a singleton-per-page ASP.NET pattern. read more...

add a comment |category: |Views: 45

tags: another

Design Patterns: Thoughts on the Singleton Pattern(honestillusion.com)

submitted by JamesCurranJamesCurran(635) 4 years, 10 months ago

Thoughts on the Singleton Pattern (Executive summary: Don't!) read more...

5 comments |category: |Views: 5

tags: another

.NET Remoting Use-Cases and Best Practices(thinktecture.com)

submitted by salimsalim(780) 4 years, 11 months ago

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. read more...

1 comment |category: |Views: 36

tags: another