1
vote
1answer
194 views

Storing session in a static variable?

I'm currently checking a older piece of C# code used to maintain a login session. public static ZRWebserviceSession CurrentSession { get { return _currSession; } set { _currSession = value; } } ...
2
votes
1answer
365 views

Why does this static field always get initialized over-eagerly?

I am looking at this excellent article from Jon Skeet. While executing the demo code, Jon Skeet says that we can expect three different kinds of behaviours. To quote that article: The runtime ...
2
votes
3answers
4k views

Static DataTable or DataSet in a class - bad idea?

I have several instances of a class. Each instance stores data in a common database. So, I thought "I'll make the DataTable table field static, that way every instance can just add/modify rows to its ...
1
vote
1answer
385 views

Drawback of implementing DDD service as static class?

Can Services in a domain-driven design be implemented as C# static class? What are the drawbacks of this choice? Can it be implemented as a non-singleton non-static class?
3
votes
3answers
7k views

Static class vs Singleton class in C# [duplicate]

Possible Duplicate: What is the difference between all-static-methods and applying a singleton pattern? I need to make a decision for a project I'm working of whether to use static or ...
4
votes
3answers
2k views

Why use sealed instead of static on a class?

Our system has several utility classes. Some people on our team use (A) a class with all-static methods and a private constructor. Others use (B) a class with all-static methods (these the juniors). ...