Click here to Skip to main content
15,912,207 members
Home / Discussions / C#
   

C#

 
QuestionNear-static class [modified] Pin
PIEBALDconsult13-Jun-08 13:25
mvePIEBALDconsult13-Jun-08 13:25 
AnswerRe: Near-static class Pin
MarkB77713-Jun-08 14:29
MarkB77713-Jun-08 14:29 
GeneralRe: Near-static class Pin
PIEBALDconsult13-Jun-08 15:28
mvePIEBALDconsult13-Jun-08 15:28 
GeneralRe: Near-static class Pin
MarkB77713-Jun-08 16:01
MarkB77713-Jun-08 16:01 
GeneralRe: Near-static class Pin
leppie13-Jun-08 21:56
leppie13-Jun-08 21:56 
GeneralRe: Near-static class Pin
PIEBALDconsult16-Jun-08 10:01
mvePIEBALDconsult16-Jun-08 10:01 
AnswerRe: Near-static class Pin
Ed.Poore13-Jun-08 20:50
Ed.Poore13-Jun-08 20:50 
GeneralRe: Near-static class Pin
PIEBALDconsult14-Jun-08 5:12
mvePIEBALDconsult14-Jun-08 5:12 
Ed.Poore wrote:
singleton


Right, and usually static classes are used for that (in C#), but statics also can't be derived from. I need to be able to derive, but each derived type also needs to be a singleton. Just using abstract won't accomplish that either.


Ed.Poore wrote:
I still don't get why you'd need to do this though.


So derived types can add or override methods.

This is all working with non-singleton classes currently, but because there's no need to allow multiple copies, it makes sense to disallow them.


Static generic classes are kinda like this. And indeed this involves generics, but in some cases I want to "override" a method when I use a particular generic parameter.
GeneralRe: Near-static class Pin
Ed.Poore14-Jun-08 8:12
Ed.Poore14-Jun-08 8:12 
GeneralRe: Near-static class Pin
PIEBALDconsult14-Jun-08 18:45
mvePIEBALDconsult14-Jun-08 18:45 
GeneralRe: Near-static class Pin
Ed.Poore14-Jun-08 21:18
Ed.Poore14-Jun-08 21:18 
GeneralRe: Near-static class Pin
PIEBALDconsult15-Jun-08 7:45
mvePIEBALDconsult15-Jun-08 7:45 
GeneralRe: Near-static class Pin
Ed.Poore15-Jun-08 9:08
Ed.Poore15-Jun-08 9:08 
GeneralRe: Near-static class Pin
PIEBALDconsult16-Jun-08 11:05
mvePIEBALDconsult16-Jun-08 11:05 
GeneralRe: Near-static class Pin
Ed.Poore16-Jun-08 11:15
Ed.Poore16-Jun-08 11:15 
GeneralRe: Near-static class Pin
PIEBALDconsult16-Jun-08 12:41
mvePIEBALDconsult16-Jun-08 12:41 
GeneralRe: Near-static class Pin
Ed.Poore16-Jun-08 13:21
Ed.Poore16-Jun-08 13:21 
GeneralRe: Near-static class Pin
PIEBALDconsult16-Jun-08 14:01
mvePIEBALDconsult16-Jun-08 14:01 
GeneralRe: Near-static class Pin
Ed.Poore16-Jun-08 14:15
Ed.Poore16-Jun-08 14:15 
GeneralRe: Near-static class Pin
Ed.Poore16-Jun-08 14:17
Ed.Poore16-Jun-08 14:17 
GeneralRe: Near-static class Pin
PIEBALDconsult17-Jun-08 6:24
mvePIEBALDconsult17-Jun-08 6:24 
GeneralRe: Near-static class Pin
Ed.Poore17-Jun-08 6:26
Ed.Poore17-Jun-08 6:26 
AnswerRe: Near-static class Pin
leppie13-Jun-08 21:49
leppie13-Jun-08 21:49 
GeneralRe: Near-static class Pin
PIEBALDconsult14-Jun-08 4:39
mvePIEBALDconsult14-Jun-08 4:39 
AnswerRe: Near-static class Pin
Lutosław14-Jun-08 22:00
Lutosław14-Jun-08 22:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.