Microsoft® .NET Distributed Applications: Integrating XML Web Services and .NET Remoting
by Matthew MacDonald
Singleton Basics
The lifetime of a typical singleton object is not tied to the client. Consider .NET Remoting, for instance. When a client makes a call, the .NET Remoting service provides a thread from its pool, which then accesses the object. Multiple clients can access the same object on multiple different threads if they make concurrent calls.
If the singleton object is stateless (in other words, it doesn’t provide any class properties or member variables), there’s really nothing to worry about. Any variables created in a method body are local to the current call. In this case, a singleton object performs like a single-call object. In fact, contrary to what you might expect, a singleton object used in this way might even perform better because ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access