1

I have a set of objects that must perform a data acquisition and transmit to one class (many-to-one).

What is the best design pattern to achieve it? I thought about to use a "reverse" order of the Observer, but I am not sure if its a good idea.

Regards,

1
  • 3
    Your question is too vague to determine what pattern might be suitable. Please expand on the details of the scenario you are trying to solve. Pseudo-code for your data-source objects or destination object would be perfect. Commented Apr 6, 2015 at 20:04

1 Answer 1

2

No pattern required as far as your description goes.

Just hold a reference to the one class in every data acquisition class and call a method on the one class. Refactor it (e.g. with command or observer pattern) only when the need arises.

Sign up to request clarification or add additional context in comments.

1 Comment

If the one class is a unique object, the singleton pattern could be used to ensure there is only one instance of that class. Furthermore, it can be used to decouple the singleton from the data acquisition classes: they do not need to keep a reference to the singleton object, but instead query the singleton class for the instance.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.