scijava / scijava-common

A plugin framework and application container with built-in extensibility mechanism :electric_plug:
BSD 2-Clause "Simplified" License
87 stars 52 forks source link

Simplify the Object/Display/DisplayViewer type hierarchies #157

Open ctrueden opened 9 years ago

ctrueden commented 9 years ago

In conjunction with imagej/imagej-common#12, we want to rework how SciJava Displays are structured.

The status quo:

We can streamline this. Let's have instead:

These changes would reduce the amount of names floating around—we would no longer need "viewers" but would only have Views and Displays. It would also help simplify the implementation of new UIs, at least from the perspective of understanding the execution flow.

ctrueden commented 9 years ago

There is also the possibility of getting rid of View altogether. Display is UI-specific and operates on a particular type T. All viz settings (e.g., dimensional position of a Dataset) would need to then wrap into Dataset itself. While this would be a slightly worse separation of concerns, it would greatly simplify the architecture, to the point where I'm thinking it's worth it.

So if you want to show the same image with same visualizations settings and position, great—add the same Dataset to two different ImageDisplays or whatever.

And if you want to show the same image with different viz settings, we can have a by-reference Dataset wrapper that exposes different settings, but for the same backing data object.

Further thought needed of course, but my current thinking is "the fewer class hierarchies, the better".