tags:

views:

195

answers:

4

Hello All,

I have a problem in which on request one process requests multiple instances (processes) of there state and after collecting data, manipulates the data and represents to the requestor.

Could you please suggest me any design pattern which solves this problem?.

-thanks Harish

+1  A: 

Your question is very hard to understand but it sounds like you could use the Observer Pattern.

You might want to look at different threading models (power point slides) as well.

DShook
+2  A: 

I recommend you to read a Design pattern book like GoF or Head First Design Patterns. You have to know where is good place for every pattern and the pattern "will come to you" when it is needed for your code.

It's a very bad practice try to use a pattern in every place.

Jesus Rodriguez
A: 

If you want to have the one process automatically update when the other processes change, then Observer pattern is the one you want to use where the one process observes the states of the others and is notified when to check for updates. Even if you are doing this on a user's request instead of automatically, an Observer pattern is still a good one to use.

For these other processes, does their state determine their behavior? If so then you might want to look into a State Pattern so you don't have to deal with multiple or nested if statements.

indyK1ng
A: 

If we're talking about sending messages between remote processes, and for some service to collate all the responses together, then perhaps you are looking for the Aggregator, or Scatter-Gather patterns?

toolkit