c# - templates, singleton

Started by
1 comment, last by joelmartinez 19 years, 1 month ago
A singleton design in c++ would involve templates to ease and remove code creation. All you did was create your templated singleton class and you inherited that. I'm trying to find out if that's at all possible for C#? The only information i'm finding when searching the net is different kinds of c# singleton design patterns, but none of them goes into templates or inheritance. I'm realy not interrested in copy pasting code for each and every class that i want to be a singleton; not that it's alot of code, it's just wrong.
Advertisement
Part of the problem is that templates (generics) are introduced in C# 2.0 (VS.NET 2005) so there are not alot of things writen about it.
You should never let your fears become the boundaries of your dreams.
I wrote an article on my blog about this:
http://www.codecube.net/item.asp?cc_itemid=245&searchstring=singleton

:-)
Joel Martinez
http://codecube.net
[twitter]joelmartinez[/twitter]

This topic is closed to new replies.

Advertisement