Quantcast
Channel: patterns & practices: Prism
Viewing all articles
Browse latest Browse all 1878

New Post: MEF with Mulitple Copies of a Service and Pub/Sub

$
0
0
I am developing a desktop application in which each object has their own copy of a service. Each object has a number of views and the sevice performs an operation dependent on which view is currently selected. I use pubsub to communicate when a view has changed. The problem I am having is that the service for object 1 subscribe is being called and the sevice for object 2 subscribe is also being called when object1 publishes the event. I hope this is sufficient enough to describe the scenario.
  1. Is it good practice to have multiple copies of a service? If not, how do you handle the case where you want to track the state of two objects separately and then perform an operation on the object based on the selected state with only one copy of the service?
  2. How is pub/sub handled when you have mutiple copies of a service but only want a one-to-one response (i.e object 1 only published to the service object that is created for object one)?

Viewing all articles
Browse latest Browse all 1878

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>