Skip to Content
Programming WCF Services, 2nd Edition
book

Programming WCF Services, 2nd Edition

by Juval Lowy
November 2008
Intermediate to advanced
784 pages
23h 28m
English
O'Reilly Media, Inc.
Content preview from Programming WCF Services, 2nd Edition

Appendix C. Publish-Subscribe Service

Using raw duplex callbacks for events has numerous drawbacks. The primary concern is that it often introduces too much coupling between the publisher and the subscribers. The subscriber has to know where all the publishing services are in the application and connect to them. Any publisher that the subscriber is unaware of will not be able to notify the subscriber of events. This in turn makes adding new subscribers (or removing existing ones) difficult in an already deployed application. There is no way for a subscriber to ask to be notified whenever anyone in the application raises a particular type of event. In addition, the subscriber must make multiple, potentially expensive calls to each publisher, both to subscribe and to unsubscribe. Different publishers may fire the same event but offer slightly different ways to subscribe and unsubscribe, which of course couples the subscribers to those methods.

Much the same way, the publisher can only send notifications to subscribers it knows about. There is no way for the publisher to deliver an event to whomever wishes to receive it, or to broadcast an event. In addition, all publishers must have the necessary code to manage the list of subscribers and the publishing act itself. This code has almost nothing to do with the business problem the service is designed to solve, and it can get fairly complex if advanced features such as concurrent publishing are employed. Since the publishers cannot assume ...

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

Programming WCF Services

Programming WCF Services

Juval Lowy

Publisher Resources

ISBN: 9780596157210Supplemental ContentErrata