Skip to Content
Microsoft® .NET Distributed Applications: Integrating XML Web Services and .NET Remoting
book

Microsoft® .NET Distributed Applications: Integrating XML Web Services and .NET Remoting

by Matthew MacDonald
February 2003
Intermediate to advanced
752 pages
16h 35m
English
Microsoft Press
Content preview from Microsoft® .NET Distributed Applications: Integrating XML Web Services and .NET Remoting

Singleton Objects

Singleton objects resemble client-activated objects in that they retain state; but the server, not the client, creates them. Only one instance of a singleton object is ever created, and it can serve any number of concurrent clients. Because the .NET Remoting services are multithreaded, clients can call methods on this object simultaneously. However, you must ensure that the object itself is thread-safe. If you modify a member variable in a singleton method, for example, you must ensure that you obtain an exclusive lock first. Otherwise, updates might be lost or inconsistent data might be applied.

We can alter the preceding example to use a singleton object without worrying. The single GetActiveDomain method just returns a static ...

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.
Start your free trial

You might also like

Applied SOAP: Implementing .NET XML Web Services

Applied SOAP: Implementing .NET XML Web Services

Kenn Scribner, Mark Stiver
Microsoft® .NET Remoting

Microsoft® .NET Remoting

Scott McLean, James Naftel, Kim Williams
.NET & XML

.NET & XML

Niel M. Bornstein

Publisher Resources

ISBN: 0735619336Catalog PageErrata