I’m leveraging the Doubleton Pattern from the Doubleton Design Pattern on Code Project in my own code. I think it makes things a lot easier since the Singleton only provides one instance, but I get two with this pattern. I was wondering if it would make sense to have it implement an interface so I can inject it into my domain layer.
I’m leveraging the Doubleton Pattern from the Doubleton Design Pattern on Code Project in
Share
Despite the usefulness and cleverness of such design, it is not possible. You can’t define a static member in an interface.
@Pierreten, If you use instance methods, imagine this:
EDIT: As @Roger Pate rightfully pointed out, my 2nd answer should be merged within this one. As he already had done it, I deleted the other one.