I am building a tabbed interface for switching between various similar layers. Each layer will have a number of graphs. By dragging with the mouse the graphs can be rearranged or even moved between layers. My question is, is it best practice to register a unique mediator for each layer that keeps track of the layers content / organization, or should i keep track of it all with one central mediator.
some considerations:
the layer contents and organization will be saved(in a db) so that it can be restored when a user comes back to the app.
the layers themselves are functionally identical.
the user can add and remove layers at will.
thanks!
For this sort of use I will generally mediate each screen in a tabbed interface individually by passing in a unique identifier with the constructor of the mediator. The layers won't require different mediator classes, just different mediator instances with unique names that are easy to retrieve. I typically override getMediatorName and return NAME + uniqueId.