vendredi 11 janvier 2019

Dispatcher Pattern for Delegating Tasks from a Central Controller

I am writing some code to listen to events from Kafka (in Java). Here's the design:

  1. A central controller that listens to events from a particular topic.
  2. Based on the message type, invoke an appropriate controller.
  3. The controller in turn invokes its handler to perform the appropriate action.

What would be the ideal design pattern that I can use for the above scenario? I tried using the visitor pattern. Is it the right choice here?

Aucun commentaire:

Enregistrer un commentaire