mercredi 18 janvier 2017

Publisher/Subscriber architecture: how do I properly send messages that require multiple modules?

I am working on a visualization. This visualization includes UI components which communicate with each other and the visualization via a Mediator (Publisher/Subscriber mechanism). I have a Model Module for pulling a data model (represented in JSON) from the database, processing it and converting it into a new model of renderable objects and a Renderer Module for rendering those objects into the visualization.

A lot of functionality involves getting data from the database, processing it and/or converting it into renderable objects, and then rendering it. As of now this requires passing data back and forth between components, which goes against the mediator pattern. How should communication occur between these modules? Callbacks seem like a bad idea.

UI Component -> Query Databases for raw Model -> Model_ProccessAndCreateModel -> UI Component -> Renderer_RenderModel

Aucun commentaire:

Enregistrer un commentaire